我得到了一个类似滑块的东西,至少它应该是be.But一些东西是不工作的,这是代码:
$('div.app').on('click' , function(){
var current = $('.article.active');
if(current.next('.article').length > 0) {
current.next('.article')
.effect("slide" ,{direction:'left', mode:'hide'},1000)
.addClass('active')
.removeClass('hide');
current.effect("slide",{direction:'right',mode:'show'},1000)
.removeClass('active')
} else {
$('.article:first').removeClass('hide').addClass('active');
}
});和JSFiddle:http://jsfiddle.net/u4m0oLsc/。
发布于 2015-02-27 05:58:17
应该在单击事件函数中声明var current = $('.article.active');,如下所示:
$('div.app').on('click' , function() {
var current = $('.article.active');
...
}Fiddle
https://stackoverflow.com/questions/28752745
复制相似问题