如何使jquery垂直滑块继续移动
我是新来的,我真的需要你的建议。我有一个jquery垂直滑块,有两个问题:如何使jquery垂直滑块继续移动,jquery,Jquery,我是新来的,我真的需要你的建议。我有一个jquery垂直滑块,有两个问题: 在最后一排之后就要停了 当我把鼠标放在一个单元格上时,它不会停止 代码如下: (function($) { $.fn.vertigo = function(options) { $(this).addClass("vertigo"); var list = $('.vertigo li'); var totallist = list.length; $(this).after('&
(function($) {
$.fn.vertigo = function(options) {
$(this).addClass("vertigo");
var list = $('.vertigo li');
var totallist = list.length;
$(this).after('<a href="#pre" class="btn-pre"><img src="prev.png"/></a> <a href="#next" class="btn-next"><img src="next.png"/></a>');
$('.vertigo li').each(function(i) {
$(this).addClass("item"+(i+1));
});
var total = 1;
// Settings
var settings = $.extend({
play : true,
timer : 1000
}, options);
if ( settings.play ) {
var playx = settings.play;
}
if ( settings.timer ) {
var timerx = settings.timer;
}
if(playx == true){
setInterval(function() {
if ( total <= (totallist - 1)) {
var nlisth = $('.item'+total).outerHeight();
$('.vertigo li').animate({'top':'-='+nlisth+'px'});
total++;
//console.log(total);
}else{
$('.vertigo li')=1;
}
}, timerx);
}
$('.btn-pre').click(function(){
var plisth = $('.item'+(total-1)).outerHeight();
if ( total !== 1 && total <= totallist) {
total--;
$('.vertigo li').animate({'top':'+='+plisth+'px'});
}
});
$('.btn-next').click(function(){
var nlisth = $('.item'+total).outerHeight();
if ( total <= (totallist - 1)) {
total++;
$('.vertigo li').animate({'top':'-='+nlisth+'px'});
}
});
}
return false;
}(jQuery));
(函数($){
$.fn.vertigo=功能(选项){
$(此).addClass(“眩晕”);
变量列表=$('.vertigo li');
var totalist=list.length;
$(本)。在('')之后;
$('.vertigo li')。每个(函数(i){
$(this.addClass(“项”+(i+1));
});
var总计=1;
//背景
变量设置=$.extend({
剧本:没错,
计时器:1000
},选项);
如果(settings.play){
var playx=settings.play;
}
if(settings.timer){
var timerx=设置。定时器;
}
如果(playx==true){
setInterval(函数(){
如果(总计)