[thelist] DOM dhtml drives me crazy

liorean liorean at f2o.org
Sun Nov 30 13:39:29 CST 2003


s t e f wrote:
> I've written a clipping script that does a nifty horizontal-scroll 
> effect. It works like expected in IE5.5+ and Mozilla.
> <http://notabene-test.dyndns.org/test_dhtml2/>

No DOCTYPE, document.compatMode => 'backCompat'

> But when i put this script in the final site it just *coughs* in Mozilla.
> <http://notabene-test.dyndns.org/rubrique.php3?id_rubrique=1>

DOCTYPE, document.compatMode => 'CSS1Compat'

> Hover on the "left" link and you'll see expected behaviour in IE5.5+ but 
> not in Mozilla. That's really weird. I get no error essage, no nothing.

It's the old 
only-properties-with-no-unit-may-be-set-without-a-unit-if-they-are-not-zero 
problem. Use parseInt on the old value, add a 'px' after the new value, 
and everything should work okay in standards compatible mode too.

> I've added a window.status to see what was happening but it's no better, 
> since Mozilla doesn't seem to be able to compute the element's left 
> position.

Yeah, and the reason for that was that you didn't account for the unit.

> I'm pretty sure there's something different somewhere but can't put my 
> finger on it.

Standards rendering mode versus quirks mode.

> Been fighting with this baby for three hours, and thought it was time to 
> call thelist to the rescue.

At your service.

-- 
liorean <mailto:liorean at user.bip.net>

ViewStyles, ViewScripts, ToggleStyles and GraphicsInfo bookmarklets and 
Theme Switcher, Cookies Handler scripts:
<http://liorean.web-graphics.com/>



More information about the thelist mailing list