buildinternet / totem

A jQuery plugin that makes vertical tickers easy.
http://buildinternet.com/project/totem/
MIT License
103 stars 20 forks source link

Last li element bug (margin-top property) #4

Open reuhno opened 13 years ago

reuhno commented 13 years ago

Hello, first sorry for my english ;)

The scroller works very well, but I saw a little bug on Chrome (14.0.835.186) and Safari (Version 5.1 (7534.48.3)) run on a Mac OsX Lion (10.7.1)

Indeed, when I run the page it works. Then I open a new tab, i stay on this tab (for 30 seconds or 1 minute). Then, when I go back to my page with "Totem", the last element stay with a margin Top negative ( margin-top:65px, in my case). The next interval fire, then the "new last li element" do the same thing, etc.

So, I did a modification that resolve my bug in the base.start_interval = function(){

I add the following lines before "base.$el.find('li:first').animate({...});" = base.$el.find('li').clearQueue(); base.$el.find('li:not(:first)').css('marginTop','0');

I don't know if it's a good way, but it's works very well for me. I tried to reproduce the bug on your demo, but I can't, I don't know why ! :s

If you've got a better solution...

Have a good day..

rpcjacobs commented 13 years ago

Hi there,

I've implemented this plugin too, and noticed the same bug, although i didn't investigate it as much as the poster "laboiteare". I've been having this bug in Firefox 7.01, and changing the suggested lines actually fixes the problem.

In my case i use this plugin to scroll through a list of twitter tweets, which are outputted by seaofclouds tweet plugin (https://github.com/seaofclouds/tweet/) combined with a live() function with the create event (http://www.erichynds.com/jquery/jquery-create-event/) since the outputted tweets are inserted after the DOM is ready.

Thanks to laboiteare for his fix, it really works splendid. Hopefully the extra information is welcome. Thanks for a great plugin.

riesart commented 12 years ago

Hi all,

I had the mentioned bug to. I implemented the solution provided by laboiteare and it solves the issue.

Thank laboiteare!