簡(jiǎn)單的Jquery遮罩層代碼實(shí)例
更新時(shí)間:2013年11月14日 16:33:42 作者:
這篇文章介紹了簡(jiǎn)單的Jquery遮罩層代碼實(shí)例,有需要的朋友可以參考一下
Css代碼
復(fù)制代碼 代碼如下:
#brg
{
width: 100%;
height: 100%;
background: #333;
position: absolute;
top: 0;
left: 0;
filter: alpha(opacity=60);
-moz-opacity: 0.6;
opacity: 0.6;
position: absolute;
top: 0;
left: 0;
display: none;
}
#showdiv
{
width: 100%;
height: auto;
position: absolute;
left: 300px;
top: 150px;
z-index: 330;
display: none;
}
#testdiv
{
width: 800px;
height: auto;
margin: 0 0;
border: 1px solid #4d4d4d;
background: #f2f2f2;
}
#close
{
width: 200px;
height: 27px;
line-height: 27px;
font-size: 14px;
font-weight: bold;
border: 1px solid #4d4d4d;
text-align: center;
cursor: pointer;
margin: 0 auto;
background: #333;
color: #fff;
}
Html 代碼
復(fù)制代碼 代碼如下:
<div id="brg">
</div>
<div id="showdiv">
<div id="close">
關(guān)閉
</div>
<div id="testdiv">
要顯示的內(nèi)容
</div>
</div>
Jquery 代碼
復(fù)制代碼 代碼如下:
$(document).ready(function() {
var bheight = document.body.clientHeight;
$("#btnAdd").click(function() {
$("#brg").css("display", "block");
$("#showdiv").css("display", "block");
$("#brg").css("height", document.body.scrollHeight);
$("#showdiv").css("top", document.body.scrollTop + 100);
});
$("#close").click(function() {
$("#brg").css("display", "none");
$("#showdiv").css("display", "none");
});
});
您可能感興趣的文章:
- JS遮罩層效果 兼容ie firefox jQuery遮罩層
- JQuery 遮罩層實(shí)現(xiàn)(mask)實(shí)現(xiàn)代碼
- jquery彈出關(guān)閉遮罩層實(shí)例
- jquery下實(shí)現(xiàn)overlay遮罩層代碼
- jQuery+AJAX實(shí)現(xiàn)遮罩層登錄驗(yàn)證界面(附源碼)
- Jquery實(shí)現(xiàn)遮罩層的方法
- jQuery遮罩層實(shí)現(xiàn)方法實(shí)例詳解(附遮罩層插件)
- jQuery點(diǎn)擊按鈕彈出遮罩層且內(nèi)容居中特效
- jquery實(shí)現(xiàn)簡(jiǎn)單的遮罩層
- jQuery彈出遮罩層效果完整示例
相關(guān)文章
jQuery實(shí)現(xiàn)CheckBox全選、全不選功能
這篇文章主要介紹了jQuery實(shí)現(xiàn)CheckBox全選、全不選功能,非常不錯(cuò),具有參考借鑒價(jià)值,需要的朋友參考下吧2017-01-01
利用javascript/jquery對(duì)上傳文件格式過(guò)濾的方法
jquery中對(duì)上傳文件格式過(guò)濾的方法,需要的朋友參考下。2009-07-07
jquery mobile changepage的三種傳參方法介紹
本來(lái)覺(jué)得changePage 那么多option,傳幾個(gè)參數(shù)應(yīng)該沒(méi)問(wèn)題結(jié)果翻遍國(guó)內(nèi)外網(wǎng)站,基本方法只有三種,下面與大家分享下,感興趣的朋友可以參考下2013-09-09
Jquery使用Firefox FireBug插件調(diào)試Ajax步驟講解
本文介紹Jquery下的Ajax調(diào)試方法,Jquery Ajax 提供了全功能的 $.ajax() 方法,還有諸如 $.get(),$.getScript(),$.getJSON(),$.post() 和 $().load() 等更為簡(jiǎn)便的方法2013-12-12
checkbox全選/取消全選以及checkbox遍歷jQuery實(shí)現(xiàn)代碼
checkbox全選/取消全選以及checkbox遍歷jQuery實(shí)現(xiàn)代碼2009-12-12
利用js(jquery)操作Cookie的方法說(shuō)明
本篇文章主要是對(duì)利用js(jquery)操作Cookie的方法進(jìn)行了詳細(xì)的說(shuō)明介紹,需要的朋友可以過(guò)來(lái)參考下,希望對(duì)大家有所幫助2013-12-12
jquer之a(chǎn)jaxQueue簡(jiǎn)單實(shí)現(xiàn)代碼
手頭不是很忙,突然想到了ajax queue這個(gè)概念,之前貌似有看技術(shù)文章中提到過(guò)這個(gè),就想著用jquery來(lái)實(shí)現(xiàn)一下,思想比較簡(jiǎn)單2011-09-09

