茄子在线看片免费人成视频,午夜福利精品a在线观看,国产高清自产拍在线观看,久久综合久久狠狠综合

    <s id="ddbnn"></s>
  • <sub id="ddbnn"><ol id="ddbnn"></ol></sub>

  • <legend id="ddbnn"></legend><s id="ddbnn"></s>

    評(píng)論回復(fù)彈出遮罩效果實(shí)現(xiàn)思路兼容ie8/chrome/firefox
    來(lái)源:易賢網(wǎng) 閱讀:1681 次 日期:2014-05-15 21:37:44
    溫馨提示:易賢網(wǎng)小編為您整理了“評(píng)論回復(fù)彈出遮罩效果實(shí)現(xiàn)思路兼容ie8/chrome/firefox”,方便廣大網(wǎng)友查閱!

    平日喜歡關(guān)注一些新聞,經(jīng)常會(huì)瀏覽!

    但是很少看到評(píng)論的回復(fù)。與是仔細(xì)尋找之,發(fā)現(xiàn)原來(lái)是通過(guò)一個(gè)頁(yè)面的彈出遮罩來(lái)顯示的。

    與是仔細(xì)研究一翻,自己模擬出來(lái)一個(gè),感覺(jué)還行,兼容ie8/chrome/firefox.

    思路:主頁(yè)面和遮罩是兩個(gè)不同的頁(yè)面,遮罩通過(guò)iframe利用js加載進(jìn)來(lái)。

    代碼如下:

    index.html

    代碼如下:

    <!DOCTYPEhtmlPUBLIC"-//W3C//DTDXHTML1.0Transitional//EN""http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

    <htmlxmlns="http://www.w3.org/1999/xhtml"xml:lang="en">

    <head>

    <metahttp-equiv="Content-Type"content="text/html;charset=UTF-8">

    <scripttype="text/javascript"src="http://ajax.googleapis.com/ajax/libs/jquery/1.7/jquery.min.js"></script>

    <title>append-iframe</title>

    <styletype="text/css">

    html,body{height:100%;padding:0px;margin:0px;}

    </style>

    </head>

    <body>

    <div><inputtype="button"value="show"id="show-id"/></div>

    <div><inputtype="button"value="test"id="test-id"/></div>

    <scripttype="text/javascript">

    $("#show-id").on("click",function(){

    $(top.document.body).append('<iframesrc="subiframe.html"id="np-pop-iframe"allowtransparency="true"frameborder="0"scrolling="no"style="width:100%;z-index:9999;position:fixed;top:0px;left:0px;border:none;overflow:hidden;height:100%;"data-nick=""data-pic=""data-id=""parentid=""></iframe>');

    });

    $("#test-id").on("click",function(){

    alert("test");

    });

    </script>

    </body>

    </html>

    subiframe.html:

    代碼如下:

    <!DOCTYPEhtmlPUBLIC"-//W3C//DTDXHTML1.0Transitional//EN""http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

    <htmlxmlns="http://www.w3.org/1999/xhtml"xml:lang="en">

    <head>

    <metahttp-equiv="Content-Type"content="text/html;charset=UTF-8">

    <scripttype="text/javascript"src="http://ajax.googleapis.com/ajax/libs/jquery/1.7/jquery.min.js"></script>

    <title>Document</title>

    <styletype="text/css">

    html,body{height:100%;padding:0px;margin:0px;}

    .np-popframe-bg-opacity{

    filter:alpha(opacity=50);

    -moz-opacity:0.5;

    opacity:0.5;

    }

    .wrapper{

    position:absolute;

    border:1pxsolidred;

    width:800px;

    height:800px;

    background:#fff;

    top:1000px;

    left:500px;

    }

    </style>

    </head>

    <bodyclass="iframe-body"style="background-image:none;width:100%;height:100%;background-position:initialinitial;background-repeat:initialinitial;">

    <divclass="np-popframe-bg-opacity"style="height:100%;width:100%;background-color:#000;"></div>

    <divclass="np-popframe-bg"id="np-popframe-bg-id"style="height:100%;width:100%;position:absolute;top:0px;left:0px;"></div>

    <divclass="wrapper"id="wrapper-id"></div>

    </body>

    <scripttype="text/javascript">

    (function(){

    $("#wrapper-id").animate({top:"100px"},"slow");

    $("#np-popframe-bg-id").on("click",function(){

    //$(window.parent.document.getElementById("np-pop-iframe")).remove();

    $("#np-pop-iframe",window.parent.document).remove();

    });

    })(jQuery);

    </script>

    </html>

    這里需要用一到濾鏡。讓加載來(lái)的遮罩保持透明.

    1np-popframe-bg-id的作用主要是顯示評(píng)論框的外部區(qū)域。當(dāng)鼠標(biāo)點(diǎn)擊該區(qū)域的時(shí)候,移除iframe.

    2div需要設(shè)置100%的高度,需要在前面加上html,body{height:100%;}的css,否則無(wú)效

    3還有一點(diǎn)就是絕對(duì)定位的absolute.

    更多信息請(qǐng)查看IT技術(shù)專欄

    更多信息請(qǐng)查看網(wǎng)頁(yè)制作
    由于各方面情況的不斷調(diào)整與變化,易賢網(wǎng)提供的所有考試信息和咨詢回復(fù)僅供參考,敬請(qǐng)考生以權(quán)威部門公布的正式信息和咨詢?yōu)闇?zhǔn)!
    相關(guān)閱讀網(wǎng)頁(yè)制作

    2026國(guó)考·省考課程試聽(tīng)報(bào)名

    • 報(bào)班類型
    • 姓名
    • 手機(jī)號(hào)
    • 驗(yàn)證碼
    關(guān)于我們 | 聯(lián)系我們 | 人才招聘 | 網(wǎng)站聲明 | 網(wǎng)站幫助 | 非正式的簡(jiǎn)要咨詢 | 簡(jiǎn)要咨詢須知 | 新媒體/短視頻平臺(tái) | 手機(jī)站點(diǎn) | 投訴建議
    工業(yè)和信息化部備案號(hào):滇ICP備2023014141號(hào)-1 云南省教育廳備案號(hào):云教ICP備0901021 滇公網(wǎng)安備53010202001879號(hào) 人力資源服務(wù)許可證:(云)人服證字(2023)第0102001523號(hào)
    云南網(wǎng)警備案專用圖標(biāo)
    聯(lián)系電話:0871-65099533/13759567129 獲取招聘考試信息及咨詢關(guān)注公眾號(hào):hfpxwx
    咨詢QQ:1093837350(9:00—18:00)版權(quán)所有:易賢網(wǎng)
    云南網(wǎng)警報(bào)警專用圖標(biāo)