I created a rotating carousel using CSS. The carousel is constructed using the 'ul' tag. To navigate left or right, I dynamically add a 'li' element to the left or right of the list by cloning the necessary value and appending/prepending it. Then, I adjust the left value of the 'ul' and utilize CSS transitions to move the 'ul' for the animation effect, achieving continuous navigation with animations.
The animation functions perfectly for the 'next' navigation, but encounters issues when moving 'back'.
The puzzling part is that when debugging the 'back' code, the animation actually works! (Could it be a timing issue? If so, why does the 'next' direction work???)
For a demonstration of the problem, click here: jsfiddle
Please note: This is not my actual code. My real code is encapsulated in an object-oriented plugin, with validations for scenarios like rapid forward and backward clicking by the user, and a polyfill for Internet Explorer using jQuery 'animate'. I also explored using a pre-made plugin, but none of them met the specific requirements I had…