zoukankan      html  css  js  c++  java
  • 支付宝轮播

    <!doctype html>
    <html lang="en">
    <head>
    <meta charset="UTF-8">
    <meta name="Generator" content="EditPlus®">
    <meta name="Author" content="">
    <meta name="Keywords" content="">
    <meta name="Description" content="">
    <title>Document</title>
    <style>
    *{margin:0px;padding:0px;}
    #flash{width:100%;height:400px;position:relative;}
    #flash .Con{width:100%;height:400px;position:relative;}
    #flash .Con .box{width:100%;height:400px;position:absolute;left:0px;top:0px;}
    #flash ul.button{width:100px;height:30px;position:absolute;left:49%;bottom:0;z-index:10000;}
    #flash ul.button li{width:13px;height:13px;list-style:none;float:left;margin:0 5px;background:url("img/dot.png") -13px 0px;}
    #flash ul.button li.hover{background:url("img/dot.png") 0px 0px;}
    </style>
    </head>
    <body>
    <div id="flash">
    <div class="Con">
    <div class="box" style="background:url('img/img1.jpg') center; z-index:1000;"></div>
    <div class="box" style="background:url('img/img2.jpg') center"></div>
    <div class="box" style="background:url('img/img3.jpg') center"></div>
    <div class="box" style="background:url('img/img4.jpg') center"></div>
    </div>
    <ul class="button">
    <li class="hover"></li>
    <li></li>
    <li></li>
    <li></li>
    </ul>
    </div>
    <script type="text/javascript" src="js/jquery.js"></script>
    <script type="text/javascript">
    var _index=0;
    var setTime=null;
    $("ul.button li").mouseover(function(){
    clearInterval(setTime);//清除定时器
    $(this).addClass("hover").siblings("li").removeClass("hover");//添加hover;
    _index=$(this).index();//获取当前序列号
    //alert(_index);
    $(".Con .box").eq(_index).fadeIn().siblings(".box").fadeOut();//show() hide()
    });
    $("ul.button li").mouseout(function(){
    autoPlay();
    });
    
    function autoPlay(){
    
    setTime=setInterval(function(){
    //alert("我是定时器");
    
    _index++;//_index+1;
    if(_index>3){_index=0;}
    $("ul.button li").eq(_index).addClass("hover").siblings("li").removeClass("hover");
    $(".Con .box").eq(_index).fadeIn().siblings(".box").fadeOut();
    },2000);
    
    }
    autoPlay();
    </script>
    </body>
    </html>
  • 相关阅读:
    js FormData 的使用
    js代码 注释 test
    JavaScript创建对象的几种 方式
    js prototype 原型
    C# 遍历对象下的 属性
    C#模拟按键
    C#获取硬盘序列号
    C#结束Explorer进程
    Java书籍推荐
    编程资料合集
  • 原文地址:https://www.cnblogs.com/nifengs/p/4605311.html
Copyright © 2011-2022 走看看