最新国产好看的视频,伊人天堂AV在线,国产Aaaaaa视频,蜜臀视频在线观看一区,人妻av色图,密臀久久久精品影片,青青视频免费观看毛片,久草在线观看视,国产三级精品色情在线

html實(shí)現(xiàn)彈窗的實(shí)例

  發(fā)布時(shí)間:2021-06-09 16:59:24   作者:小小文呀   我要評(píng)論
本文將結(jié)合實(shí)例代碼,介紹html實(shí)現(xiàn)彈窗的實(shí)例,具有一定的參考價(jià)值,感興趣的小伙伴們可以參考一下

上午閑來(lái)無(wú)事,用html及原生js寫(xiě)個(gè)彈窗,供參考。

<!DOCTYPE html>
<html>
 <head>
  <meta charset="utf-8" />
  <title></title>
  <style type="text/css">
   body{
    margin: 0px;
   }
   .zhezhao{
    position: fixed;
    left: 0px;
    top: 0px;
    background: #000;
    width: 100%;
    height: 100%;
    opacity: 0.5;
   }
   .tankuang{
    position: relative;
    background: #fff;
    width: 50%;
    height: 80%;
    border-radius: 5px;
    margin: 5% auto;
   }
   #header{
    height: 40px;
   }
   #header-right{
    position: absolute;
    width: 25px;
    height: 25px;
    border-radius: 5px;
    background: red;
    color: #fff;
    right: 5px;
    top: 5px;
    text-align: center;
   }
  </style>
 </head>
 <body>
  <button type="button" onclick="dianwo()">點(diǎn)我</button>
  <div class="zhezhao" id='zhezhao'>
   <div class="tankuang">
    <div id="header">
     <span>我是彈窗</span>
     <div id="header-right" onclick="hidder()">x</div>
    </div>
   </div>
  </div>
  <script type="text/javascript">
   document.getElementById('zhezhao').style.display="none";
   function dianwo(){
    document.getElementById('zhezhao').style.display="";
   }
   function hidder(){
    document.getElementById('zhezhao').style.display="none";
   }
  </script>
 </body>
</html>

到此這篇關(guān)于html實(shí)現(xiàn)彈窗的實(shí)例的文章就介紹到這了,更多相關(guān)html彈窗內(nèi)容請(qǐng)搜索腳本之家以前的文章或繼續(xù)瀏覽下面的相關(guān)文章,希望大家以后多多支持腳本之家!

相關(guān)文章

最新評(píng)論

南通市| 武鸣县| 辉县市| 大兴区| 寿光市| 兰溪市| 萍乡市| 常山县| 大宁县| 石景山区| 遂平县| 襄城县| 怀集县| 信阳市| 泗水县| 涟水县| 拉萨市| 沙雅县| 兖州市| 鸡西市| 弥渡县| 兴和县| 高台县| 孙吴县| 聂荣县| 新安县| 新沂市| 资中县| 和田市| 绥化市| 闽清县| 扎囊县| 阿克| 连云港市| 华亭县| 大埔区| 武清区| 上饶市| 武平县| 诸暨市| 安义县|