PDA

View Full Version : Announcement Carousel


BulliM
11-18-2017, 06:37 PM
There are some announcements active on my forum start site. It would be nice, if they were animated, so every announcement (not only first one) can be seen by users. So I try to animate them by JS. This works:

if($("span.control").length && $("div.announcement-tabs").length){
var secondsperelement = 5;
var announcementelements = $("div[data-index]"),
i = 0;
$(announcementelements[0]).show();
var loopseconds = secondsperelement*announcementelements.length*1000 ;
(function announcementloop() {
announcementelements.delay(loopseconds).toggle(0). eq(++i%announcementelements.length).show(0, announcementloop);}());
}


But this runs not smooth and is not smart. Another way to animate, is to define an array of content and change html content by js. But before I programm it by myself, I ask for an existing mod.

So my question is: Is there an existing mod, who animate announcements?