So, I am attempting to build an infinite jQuery carousel and it's working pretty well in one direction but not in another. Well it is working in another, but only sort of.
To make infinite manipulation happen, this is what I do:
if(navId == 'forward')
{
$('#slides ul').animate({'left':left_indent},1200, function(){
$('#slides li:last').after($('#slides li:first'));
$('#slides ul').css({'left':0});
} );
}
if(navId == 'backward')
{
$('#slides ul').animate({'left':right_indent},1200, function(){
$('#slides li:first').before($('#slides li:last'));
$('#slides ul').css({'left':0});
} );
As you can see, it is just some subtle dom manipulation and it works perfectly for 'forward' but for 'backward', it is glitchy. You can check it out here @ JSFIDDLE
I have done some tricks to counter this, but none of them are working. Anybody know what's up?