Open rcdmk opened 9 years ago
if($('.newsticker li').length >1) //condition before calling newsTicker plugin $('.newsticker').newsTicker();
It was the workaround I've used.
Would be nice if it could be disabled by code to allow dynamic contente to be added and removed and the plugin wold be aware.
Maybe I can fork it to make it happen. Thank you!
+1
Although this won't work well if you are adding and removing stuff dynamically from the ul/ol.
In this case, I added a check on the moveDown and moveUp functions - whereby I init the animations only if more than one item is on the list - otherwise remove existing animations bound to the single element in the list.
This is an example:
moveDown: function () { if (this.$el.children('li').length > 1) { .... } else { this.$el.children('li').stop(true, true); } },
Same thing applies for moveUp
Hope this helps.
Chris
When there is only one item in the scroll the ticker stills animate it. It would be usefull to add a configuration flag to turning this off.
I can confirm this occurs on a page with multiple tickers.