jcarousel problem at 16th click on next
I use jCarousel, with prev/next button as image.
function mycarousel_initCallback(carousel) {开发者_开发技巧
jQuery('#mycarousel-next').bind('click', function() {
carousel.next();
return false;
});
jQuery('#mycarousel-prev').bind('click', function() {
carousel.prev();
return false;
});
};
// Ride the carousel...
jQuery(document).ready(function() {
jQuery("#mycarousel").jcarousel({
scroll: 1,
initCallback: mycarousel_initCallback,
// This tells jCarousel NOT to autobuild prev/next buttons
buttonNextHTML: null,
buttonPrevHTML: null
});
});
I have 21 image (). If I start to click on next button, all is right until the 16th click. At 16th click on next button, images scrolls back of 3 images.
Any clue? Alberto
i've just found the solution, and it's really interesting. just upgrade your jquery to the latest version.
jquery prior to 1.5 have this confirmed bug.
$.fn.animate cannot "start" from any value less than -10000 http://bugs.jquery.com/ticket/7193
the reason it's the 16th image is: 10.000/16 = 625px. 10.000/17 = 588px
your images are sized between 588-625px right?
best, alp
精彩评论