自动弹窗 自适应定时弹窗代码.html
<html>
<head>
<style type="text/css">
.tanchuang{
position: absolute;
width:400px;
height:400px;
left:5px;
right:20px;
top: 120px;
bottom: 120px;
background-color: #fff;
-webkit-background-clip: padding-box;
background-clip: padding-box;
border: 1px solid #999;
border: 1px solid rgba(0,0,0,.2);
border-radius: 6px;
outline: 0;
-webkit-box-shadow: 0 3px 9px rgba(0,0,0,.5);
box-shadow: 0 3px 9px rgba(0,0,0,.5);
font-size: 22px!important;
line-height: 1.4;
text-align: center;
}
</style>
<script type="text/javascript">
//<!--关闭弹窗-->
function turnoff(obj){
document.getElementById(obj).style.display="none";
}
// 创建定时器,需要绑定事件,指定时间(ms)
var myModal=setTimeout(function(){
var myModal=document.getElementById('myModal')
myModal.style.display="inline"
},60000)
</script>
</head>
<body>
<div class="tanchuang" id="myModal" style="display:none"><a href="#" onclick="javascript:turnoff('myModal')">点击关闭</a>
<iframe height="800" allowTransparency="true" scrolling="no" style="display:block;min-width:100%;width:100px;border:none;overflow:auto;" frameborder="0" src="https://xieruiyi.58how.com.com/AIPQdSi"></iframe>
</div>
position:absolute;border:1px solid #ccc;background:#efefef; display:none;
background:#ddd; display:block; height:33px; cursor:move;
float:right; line-height:33px; padding:0 8px;cursor:default;
</body>
</html>
发表评论 取消回复