JQUERY演示图片上下滑动展示效果

jquery确实是个好东西,简单方便,代码优美。下面是一个JQUERY实现的图片上下滚动的代码,模仿淘宝首页的广告图片展示效果
调用代码
$( function (){
     
var  len   =  $( " #numeric > li " ).length;
     
var  index  =   0 ;
     $(
" #numeric li " ).mouseover( function (){
        index  
=    $( " #numeric li " ).index( this );
        rotatorimg(index);
    });    
     $(
" #timer " ).hover( function (){
              
if (MyTime){
                 clearInterval(MyTime);
              }
     },
function (){
              interval 
=  setInterval( function (){
                rotatorimg(index)
                index
++ ;
                
if (index == len){index = 0 ;}
              } , 
2000 );
     });
     
var  interval  =  setInterval( function (){
        rotatorimg(index)
        index
++ ;
        
if (index == len){index = 0 ;}
     } , 
5000 );
})

function  rotatorimg(i){
        $(
" #mobanscnSlider " ).stop( true , false ).animate({top :  - 188 * i}, 400 );
        $(
" #numeric li " ).eq(i).addClass( " on " ).siblings().removeClass( " on " );
}

  • 1
  • 2
  • 3
  • 4
下载地址: http://files.cnblogs.com/dotnetshow/Slider.rar

转载于:https://www.cnblogs.com/dotnetshow/archive/2009/09/23/1572957.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值