• 欢迎访问搞代码网站,推荐使用最新版火狐浏览器和Chrome浏览器访问本网站!
  • 如果您觉得本站非常有看点,那么赶紧使用Ctrl+D 收藏搞代码吧

用php实现广告图片循环播放

php 搞代码 4年前 (2022-01-22) 11次浏览 已收录 0个评论
<!DOCTYPE><html><head>    <meta http-equiv="content-type" content="text/html" charset="utf-8">    <title>Image play</title>    <style>        body{            width:430px;            margin:20px auto;        }        p.now{            display:block;            width:400px;            height:200px;            overflow:hidden;            border:1px solid #ccc;        }        li.now{            color:#ccc;        }        li{            list-style:none;            float:left;            padding:0 10px;            margin-bottom:5px;            border:1px solid #ccc;            background:#eee;        }        #fd{            list-style:none;            float:left;            padding:0 10px;            border:1px solid #ccc;            margin:0 auto;            background:#eee;        }        img{            width:400px;            height:200px;            padding:1px;            /*padding-top:18px;*/        }    </style></head><body><p id="fd">    <p class="now"><img src="./images/pic1.jpg"></p>    <p style="display:none;"><img src="./images/pic2.jpg"></p>    <p style="display:none;"><img src="./images/pic3.jpg"></p>    <p style="display:none;"><img src="./images/pic4.jpg"></p>    <ul>        <li class="now">1</li>        <li&g<a>@本文9来源gao($daima.com搞@代@#码8网^</a><strong>搞代gaodaima码</strong>t;2</li>        <li>3</li>        <li>4</li>    </ul></p><script>    var tags=$("fd").getElementsByTagName("li"); // 获取切换按钮节点    var cats=$("fd").getElementsByTagName("p"); // 获取切换内容节点    var current; // 高置当前帧的变量宣容器    var timer=2000; // 设置2秒循环一次    function disAll(){        for(var i=0; i<tags.length; i++){            tags[i].className="";            cats[i].className="";            cats[i].style.display="none";        }    }    function setNow(){        for(var i=0; i<tags.length; i++){            if(tags[i].className=="now"){                current=i;            }        }    }    for(var j=0; j<tags.length; j++){        tags[j].onmouseover=function(){            clearInterval(h);            disAll();            this.className="now";            setNow();            cats[current].style.display="block";            cats[current].className="now";        }        tags[j].onmouseout=function(){            setNow();            h=setInterval("goNext()", 3000);        }    }    function goNext(){        setNow();        current+=1;        if(current>=parseInt(tags.length)){            current=0;            disAll();            cats[0].style.display="block";            tags[0].className="now";            cats[0].className="now";        }else{            disAll();            cats[current].style.display="block";            cats[current].className="now";            tags[current].className="now";        }    }    var h=setInterval("goNext()", timer);    function $(obj){        return document.getElementById(obj);    }</script></body></html>

以上就是用php实现广告图片循环播放 的详细内容,更多请关注搞代码gaodaima其它相关文章!


搞代码网(gaodaima.com)提供的所有资源部分来自互联网,如果有侵犯您的版权或其他权益,请说明详细缘由并提供版权或权益证明然后发送到邮箱[email protected],我们会在看到邮件的第一时间内为您处理,或直接联系QQ:872152909。本网站采用BY-NC-SA协议进行授权
转载请注明原文链接:用php实现广告图片循环播放
喜欢 (0)
[搞代码]
分享 (0)
发表我的评论
取消评论

表情 贴图 加粗 删除线 居中 斜体 签到

Hi,您需要填写昵称和邮箱!

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址