1

Crafted this real quick for an example:

e = document.getElementById('STACKME');
ticker=0;
checkloop = setInterval(function(){
    console.log(e);
    ticker++;
    if(ticker > 5){
        clearInterval(checkloop);
    }

}, 100);

See on jsFiddle : http://jsfiddle.net/jzau7bhf/1/

Now, I could simply just use that code above and it times perfectly with that given text. Problem is.. if that text is let's say.. over 2000 characters long, this script wouldn't be accurate and the timing would be off.

With that said, is it possible to check if the <marquee> attribute has finished looping?

NiCk Newman
  • 1,716
  • 7
  • 23
  • 48

2 Answers2

2

How about the onfinish event?

var e = document.getElementById('STACKME');
e.onfinish = function(){
    console.log('completed');
};
Johan
  • 35,120
  • 54
  • 178
  • 293
1

The marquee element has a set of event handlers. You should note that this tag is non-standard at this point in time, and you should use other methods to implement this behaviour.

See this SO question & answer for an example:

CSS3 Marquee Effect

Community
  • 1
  • 1
Oka
  • 23,367
  • 6
  • 42
  • 53