Archive for October, 2012

Firefox marquee restarts prematurely

I was trying to fix a HTML marquee bug today, where only on Firefox the marquee restarts itself before the whole message scrolls to the end. After stripping down the page the cause appears to be Firefox observing the length of the original text (which was just a single space character).

The HTML code below reproduces it. Click on “Change Marquee Text” to see the difference between the two marquees.


<html>
<body>
<marquee id="m" style="color:white;background:black;width:300px">At first</marquee>
<br/>
<button onclick="document.getElementById('m').innerHTML='Later, the marquee text became longer but Firefox does not recognize it.'">Change Marquee Text</button>
<br/>
<marquee id="m" style="color:white;background:black;width:300px">Later, the marquee text became longer but Firefox does not recognize it.</marquee>
</body>
</html>

Not worth to further investigate here, I just dynamically re-rendered a container div for this marquee.

Comments