//定时弹窗
<script type="text/javascript">
var time;
/**
* setInterval()方法会不断调用函数,直到clearInterval()被调用或者窗口被关闭。由setInterval()返回值的ID 值
* 可用作clearInterval()方法的参数
* 如果你只想执行一次可以使用setTimeout()方法
* **/
window.onload=function () {
//var time =window.setInterval("imgblock()",500);
window.setTimeout("imgblock()",1000);
}
function imgblock() {
var img_idDIV=document.getElementById("img_idDIV");
img_idDIV.style.display="block";
window.clearInterval(time);
window.setInterval("imgNone()",5000);
}
function imgNone() {
var img_idDIV=document.getElementById("img_idDIV");
img_idDIV.style.display="none";
}</script>
<style>
.addimg{
max-width:200px;
/* box-shadow: 0 0 0 9999px #000; */
/* background: rgba(29,31,32,.65); */
/* max-height:100%; */
right: 10px;background:#fff;
bottom: 5px;padding:5px;color:red;
z-index:999;
/* transform:translate(-50%,-50%); */
/* -webkit-transform:translate(-50%,-50%); */
position:fixed;
overflow: hidden;
display: none;
}.addimg img{max-width: 200px;}
</style><!-- border :border-width, border-style,和border-color.-->
<!-- Position(定位):absolute 绝对定位 绝对定位的元素的位置相对于最近的已定位父元素,如果元素没有已定位的父元素,那么它的位置相对于<html>:-->
<div id="img_idDIV" class="addimg" ><script language="JavaScript" type="text/javascript">
tips = new Array(0);
tips[0]='<a href="https://m.tb.cn/h.f9QYrKh"><img title="wp-1642178686551" class="alignnone size-full" alt="【叶一茜推荐】浴室瓷砖清洁剂拍2件发3瓶,领40元券 日本品牌!" height="200" src="http://www.qixibang.cc/wp-content/uploads/2022/01/wp-1642178686551.jpg" /></a>【叶一茜推荐】浴室瓷砖清洁剂拍2件发3瓶,领券后价29 日本品牌';tips[1]='<a href="https://m.tb.cn/h.f9jBnIK"><img title="wp-1642177617710" class="alignnone size-full" height="200" alt="image" src="http://www.qixibang.cc/wp-content/uploads/2022/01/wp-1642177617710.jpg" /></a>淘宝年货节';
index = Math.floor(Math.random()*tips.length);
document.getElementById("img_idDIV").innerHTML = tips[index];
</script></div>
ADHTML
Next: 2021年岛国女优排行榜
- 解决Google 文字转语音和讯飞语音引擎3.0都无法更换的方法 - 2018-10-16 周二
- 2022年Windows安装Android子系统方法来了 - 2022-2-22 周二
- 让MacOS快速升级的方法 - 2017-7-24 周一
- WordPress付费查看阅读插件:WPPAY永久版
- 多仓多线路影视应用及接口随便睇