jquery手机端打开时弹出提示框效果,可用于活动公告等

<style>
*{margin:0px;padding: 0px;}
#shareit {-webkit-user-select: none;display: none;position: absolute;width: 100%;height:200%;
  background: rgba(0,0,0,0.85);text-align: center;top: 0;left: 0;z-index: 105;
}
#shareit img { max-width: 100%;}
.arrow {margin:10% auto;}
#follow{width: 100%;height: 50px;line-height: 50px;text-align: center; text-decoration: none;font-size: 18px;color: white;float: left;margin-top:-50px;}
 </style>
 <div id="shareit">
  <img class="arrow" src="{APP_PATH}statics/default/mob/img/top_img.png" style="width:300px;height:500px;">
  <a href="#" id="follow">关闭</a>
</div>

<script>
          //为TA拉票
          $("#shareit").on("click", function(){
            $("#shareit").hide();
          })

        window.onload =function(){
        var res = document.cookie.indexOf("name");
        if(res!=0){
        var oDate =new Date();
        document.cookie ="name=zheng;";
        document.getElementById('shareit').style.display ='block';
        }
        }
        //if(window.name == ""){
        // window.name = "isReload"; // 在首次进入页面时我们可以给window.name设置一个固定值 
        // document.getElementById('shareit').style.display ='block';
        //}
        </script>
发布了111 篇原创文章 · 获赞 3 · 访问量 22万+

猜你喜欢

转载自blog.csdn.net/yh_bxhl/article/details/104219178
今日推荐