国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 語言 > JavaScript > 正文

簡單的Jquery遮罩層代碼實例

2024-05-06 15:55:08
字體:
來源:轉載
供稿:網友
這篇文章介紹了簡單的Jquery遮罩層代碼實例,有需要的朋友可以參考一下

Css代碼

復制代碼 代碼如下:


 #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 代碼

復制代碼 代碼如下:


 <div>
    </div>
    <div>
        <div>
            關閉
        </div>
        <div>


  要顯示的內容

        </div>
    </div>

Jquery 代碼

復制代碼 代碼如下:


 $(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");
            });
        });

發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表

圖片精選

主站蜘蛛池模板: 保德县| 锡林郭勒盟| 永寿县| 当涂县| 南昌县| 云和县| 遂川县| 苍梧县| 洞头县| 增城市| 凤翔县| 女性| 井陉县| 改则县| 离岛区| 长宁县| 云阳县| 锡林浩特市| 偃师市| 南郑县| 舞阳县| 汝州市| 雷波县| 灵璧县| 新化县| 丰台区| 济南市| 巍山| 威海市| 巫山县| 井冈山市| 安庆市| 民和| 图们市| 平阴县| 新河县| 威海市| 高青县| 普格县| 彝良县| 花莲县|