- <!DOCTYPE html>
- <HTML lang="en">
- <head>
- <meta charset="UTF-8">
- <title>
- </title>
- <script type="text/javascript">
- var time;
- /**
- * setInterval() 方法会不断调用函数, 直到 clearInterval() 被调用或者窗口被关闭. 由 setInterval() 返回值的 ID 值
- * 可用作 clearInterval() 方法的参数
- * 如果你只想执行一次可以使用 setTimeout() 方法
- * **/
- Windows.onload = function() {
- // var time =Windows.setInterval("imgblock()",2000);
- Windows.setTimeout("imgblock()", 2000);
- }
- function imgblock() {
- var img_idDIV = document.getElementById("img_idDIV");
- img_idDIV.style.display = "block";
- // Windows.clearInterval(time);
- //Windows.setInterval("imgNone()",2000);
- }
- function imgNone() {
- var img_idDIV = document.getElementById("img_idDIV");
- img_idDIV.style.display = "none";
- }
- </script>
- <style>
- img{ width: auto; height: auto; max-width:100%; max-height:100% ; }
- </style>
- </head>
- <body>
- <!-- border :border-width, border-style, 和 border-color.-->
- <!-- Position(定位):absolute 绝对定位 绝对定位的元素的位置相对于最近的已定位父元素, 如果元素没有已定位的父元素,
- 那么它的位置相对于 < html>:-->
- <div id="img_idDIV" style="width: auto;position:absolute;right:0px;bottom:0px;overflow: hidden;display: none;">
- <a href="https://www.baidu.com/">
- <img src="./3/danei.jpg">
- </a>
- </div>
- </body>
- </HTML>
来源: http://www.bubuko.com/infodetail-3136010.html