调用代码
$(
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 " );
}
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 " );
}
下载地址: http://files.cnblogs.com/dotnetshow/Slider.rar