我有拥有像幻灯片滚动动态的项目清单,并显示在列表的最后一个项目的时候,我不能设置限制带箭头的滚动。停止观看最后一个项目时滚动 - 与jQuery
任何想法,我怎么能停止观看的最后一个项目时滚动?这里的例子:JSFIDDLE
$('.nextArrow').click(function() {
//Animate the images to next slide
$('.thumbs li:eq(0)').animate({"margin-top": "-=80"}, 500);
});
$('.prevArrow').click(function() {
var marginTopValue = $('.thumbs li:eq(0)').css('margin-top');
//Animate the image to previous slide
if (marginTopValue == '0px') {
} else {
$('.thumbs li:eq(0)').animate({"margin-top": "+=80"}, 500);
};
});
@charlietfl 我只是赶上了计算逻辑:对 –