Please could someone explain why the following doesnt work. This happens on the same click event but the CSS function is not straight after so I dont want to use the callback on the animate function if possible.
Note: animation fires but css doesnt.
container.animate({
left : (posLeft + slideWidth),
});
container.css({
left : '-'+(itemsLength + startX)+'px',
});
.animateisn’t synchronous, that is, there’s absolutely no guarantee that.cssis called after.animateis (visually) completed. So in your case, after.animateis called,.cssis immediately called, but theleftposition is quickly overriden by.animatethat internally callssetInterval.According to the docs, the second argument could be an object that defines the option, and one of them is
complete