I have created a slider using a ul
list that contains 15 li
elements.
The slider displays groups of 5
elements at a time. However, after clicking the next or previous buttons three times, it stops displaying any new elements. This is because I used right: "+=855"
to move the elements, which reaches the end of the 15 elements after three movements.
I would like the slider to loop back to the beginning on the fourth click (showing elements 1-5).
You can see an example of what I mean here: http://jsfiddle.net/mpx83tpv/1/
Is there any additional parameter I can add to the animate
function to achieve this looping behavior?