@whoremoan the code does
initial calc
tickerBody.style.animationDuration = Math.round(this.config.updateInterval / 1000) + "s";
this one u can change in config
then using the actuals it does
function calcSpeed(speed) {
// Time = Distance/Speed
var spanSelector = document.querySelectorAll("headline"),
i;
for (i = 0; i < spanSelector.length; i++) {
var spanLength = spanSelector[i].offsetWidth,
timeTaken = spanLength / speed;
spanSelector[i].style.animationDuration = timeTaken + "s";
}
}
calcSpeed(100);
so, it calculates seconds in characters divided by 100/second,
this second one for me is suspect, as until getDom() returns the 1st time, there are NO spans with headline class IN the dom.
then on each other pass, there is the old one being replaced
so THIS new (about to be shown headline is a fixed rate. regardless of content size
probably the bigger problem is that the end of animation calls
scheduleUpdateInterval: function() {
var self = this;
self.updateDom(self.config.animationSpeed);
timer = setInterval(function() {
self.activeItem++;
self.updateDom(self.config.animationSpeed);
}, this.config.updateInterval);
},
which refreshes the content AND starts a repeating time that does that too… on a fixed schedule.
but it keeps starting new timers, on top of prior timers…