I'm trying to make a news ticker (without any plug-in). I use jQuery UI's animate method to make the news move from right to left.
I'm removing the first news (li) and attaching it to the end of the list (ul) and readjusting the margin-left. This is not to get a long white space every after cycle.
Problem is... when I .remove() the first news, it's causing an undesirable UI glitch (at least for me). This part:
leftMargin = leftMargin + $('.news-ticker-display li:first').width() - 2;
$('.news-ticker-display li:first').remove();
Here's my jsFiddle link:
Any help/suggestion/comment/alternative will be greatly appreciated. Sorry I can't think a constructive title for this. lol