blockUI彈出層
html代碼如下:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html;charset=UTF-8" />
<title>blockUI(彈出層)</title>
<style type="text/css">
#demo {
width:100px;
height:24px;
text-align:center;
}
#displayBox{
display:none;
}
</style>
</head>
<body>
<button id="demo">點擊彈出</button>
<div id="displayBox">
這裏是彈出層顯示的內容!!!<br /><br /><br /><a href="javascript:void(0);" οnclick="$.unblockUI();return false;" title="點擊關閉">點擊關閉</a>
</div>
</body>
</html>
<script type="text/javascript" src="jquery.min.js"></script>
<script type="text/javascript" src="jquery.blockUI.js"></script>
js代碼如下:
$('#demo').click(function(){
$.blockUI({
message: $('#displayBox'),
css: {
width: '500px',
height: '100px',
backgroundColor: '#eee',
border: '1px solid red',
color: 'green',
textAlign: 'center',
cursor: 'default'
}
});
});
參數說明:
message = 需要彈出的內容
css = 彈出內容的樣式
其中屬性需要寫成js的形式,如 background-color => backgroundColor
$.unblockUI() = 關閉函數
具體下載地址:http://download.csdn.net/detail/athrunzero/4454660
PS:博客搬家了,以後不再 CSDN 更新了,見諒。最新博客地址:http://www.cnblogs.com/yjzhu/