I'm trying to make a simple marquee in Javascript, and need to get the full content width of innerDIV in the following:
<div id="container" style="width: 100%; overflow: hidden;">
<div id="innerDiv" style="direction: rtl; white-space: nowrap; overflow: visible; position: relative;">
very long ... text
</div>
</div>
I tried scrollWidth. It works well in Chrome but not in Firefox (where it gives the value of clientWidth instead).
Here is a live demonstration: http://jsfiddle.net/5fPGy/3/ (try it with Chrome and Firefox)
Does anyone know why? and how to get that full width?
Thanks in advance.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…