jcarousellite items jump places in scroll when number of items isn't divisible by scroll number

StackOverflow https://stackoverflow.com/questions/7677706

  •  07-02-2021
  •  | 
  •  

Question

I have jCarouselLite ( http://www.gmarwaha.com/jquery/jcarousellite/#doc ) running on one of my pages, and have an issue with scrolling.

I have it set to always show 3 items, and to scroll 3 items at a time, and cirular set to true.

$(".carousel-1").jCarouselLite({
        btnNext: ".carousel-next-1",
        btnPrev: ".carousel-prev-1",
        circular:true,
        easing: 'easeInOutCubic',
        speed: 600,
        scroll: 3,
        visible: 3
});

No problem unless the total number of items is not divisible by 3 - in which case, when you are aproaching the last item in the list, the visible items will 'jump' 1 place to the left as the carousel updates the content.

An obvious workaround would be to limit the number of results to something divisible by 3, needless to say this isn't a good option.

Anyone else have this issue?

Was it helpful?

Solution

I just limited the number of results to something divisible by three, after trying everything I could think of.

I even had a trawl through the source code and tried patching it myself, however I didn't get too far due to time constraints. I'd say a fix is possible if someone had the time to spend on it.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top