zoukankan      html  css  js  c++  java
  • JS实现定时弹出广告

    <!DOCTYPE html>
    <html lang="en">
    <head>
        <meta charset="UTF-8">
        <title>JS实现定时弹出广告</title>
        <script type="text/javascript">
            var time;
            /**
             * setInterval()方法会不断调用函数,直到clearInterval()被调用或者窗口被关闭。由setInterval()返回值的ID 值
             * 可用作clearInterval()方法的参数
             * 如果你只想执行一次可以使用setTimeout()方法
             * **/
            window.onload=function () {
               // var time =window.setInterval("imgblock()",2000);
                window.setTimeout("imgblock()",2000);
            }
            function imgblock() {
                var img_idDIV=document.getElementById("img_idDIV");
                img_idDIV.style.display="block";
               // window.clearInterval(time);
                //window.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=" 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>
  • 相关阅读:
    Loadrunner日志设置与查看
    Mysqlfunc.c
    loadrunner生成随机uuid的方法
    数据库连接
    FAQ_2
    JAVA VUser
    FAQ_1
    LoadRunner中的Web 函数列表
    MySQL性能诊断与调优
    LoadRunner书籍推荐
  • 原文地址:https://www.cnblogs.com/topsyuan/p/11255518.html
Copyright © 2011-2022 走看看