• 焦点图插件-06


    <div class="bannerbox">
              <ul class="wwul">
                   <li><a href="#" target="_blank"><img src="images/banner1.jpg" width="600" height="300"></a></li>
                   <li><a href="#" target="_blank"><img src="images/banner2.jpg" width="600" height="300"></a></li>
                   <li><a href="#" target="_blank"><img src="images/banner3.jpg" width="600" height="300"></a></li>
                   <li><a href="#" target="_blank"><img src="images/banner4.jpg" width="600" height="300"></a></li>                                  
              </ul>
              <ol class="olbg">
                <li>1</li>
                <li class="hbg1">2</li>
                <li>3</li>
                <li>4</li>
              </ol>
    </div>

    .bannerbox{ 600px; height:300px; overflow:hidden; position:relative; margin:50px auto;}
    .bannerbox .wwul{ 6000px;}
    .bannerbox .wwul li{ float:left; 600px;}
    .bannerbox .olbg{ position:absolute; right:10px; bottom:10px;}
    .bannerbox .olbg li{ 16px; height:16px; text-align:center; line-height:16px; color:#fff; border:1px #CCCCCC solid; float:left; margin:0 10px; cursor:pointer; background:#333;}
    .bannerbox .olbg .hbg1{ background:#f00; color:#FFF;}

    $(document).ready(function(){
       function ft(li_w,wrap_1,num_h,width_1,hover_1){
                      var liw=li_w.width();
                      var repeat;
                      var index=0;
                      var length_1=li_w.length;
                      wrap_1.hover(function(){
                               clearInterval(repeat)
                      },function(){
                              repeat=setInterval(function(){
                                  index++;
                                  if(index==length_1)
                                  { index=0};
                              ht(index)
                              },3000)
                       }).trigger("mouseout");

                   num_h.mouseover(function(){
                       index=num_h.index(this);
                   ht(index)
             });
     
                  function ht(index){
                         width_1.stop().animate({"marginLeft":-liw*index});                  
                         num_h.eq(index).addClass(hover_1).siblings().removeClass(hover_1);
                   };
           };
          ft($(".wwul li"),$(".bannerbox"),$(".olbg li"),$(".wwul"),("hbg1"));
            
        
    });

  • 相关阅读:
    .Net Core Swagger配置
    MySQL如何使用索引
    一个HTTP Basic Authentication引发的异常
    跑步花钱吗?
    跑步花钱吗?
    OpenShift中的持续交付
    在AWS中部署OpenShift平台
    壮美大山包-2017中国大山包国际超百公里ITRA积分赛赛记
    膝盖中了一箭之康复篇-两周年纪念
    HashiCorp Vault介绍
  • 原文地址:https://www.cnblogs.com/su1637/p/8178267.html
Copyright © 2020-2023  润新知