国产探花免费观看_亚洲丰满少妇自慰呻吟_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");
            });
        });

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

圖片精選

主站蜘蛛池模板: 青阳县| 商都县| 兴海县| 广宗县| 吉水县| 应用必备| 龙游县| 南阳市| 新和县| 福建省| 永靖县| 赤城县| 建宁县| 岳阳县| 广汉市| 安龙县| 宁夏| 大石桥市| 丰县| 阿合奇县| 库尔勒市| 沙洋县| 扬中市| 万州区| 南平市| 拉萨市| 五大连池市| 郸城县| 贵阳市| 赞皇县| 永和县| 汝阳县| 稷山县| 木兰县| 克什克腾旗| 墨玉县| 太和县| 新乐市| 秦皇岛市| 泾阳县| 库尔勒市|