[thelist] div properties in DOM1 browsers

Vincent Birebent vincent.birebent at laposte.net
Sat Feb 17 05:57:33 CST 2001

use offsetHeight property instead.

You can use your browser address bar to make your javascript test
For instance type this instead of the url :

At 13:28 17/02/2001 +0200, you wrote:
>hi all - can anyone help?
>I'm having problems upgrading my site to the standards-compliant DOM used in
>Netscape 6 and IE 5.
>I have a <div> element with a unique id, which encases a body of text.
>I want to know the height and the top position of the <div> element once the
>text has rendered in the browser... (to scroll it - and let it stop when the
>scrolling is done)
>I use "document.getElementByID('id').style.height" to access the property,
>but unless I explicitly initialize the height/top for that element through
>javascript, or inline with a style attribute, the property remains empty...
>I don't want to be explicit, because the length of my text may change, as
>may the position of the div on the page.
>I would previously access the "height" of a div using
>"document.all[id]clientHeight" for IE4/5 or document.layers[id].clip.height
>for NN4
>I would access the "top" by using document.all[id].style.pixelTop for IE and
>document.layers[id].top for Netscape.
>Are there replacements for these in the W3 DOM?
>*thought: Is this becase elements on HTML pages are all now strictly data
>objects... is there a way to access the browsers' rendering of the element?
>My homepage is the one I'm trying to update http://www.admataz.com It has a
>scrolling element that works for the document.all and document.layers DOMs
>(NN4;IE4;IE5 - not N6).  I've also posted a generic example that has all the
>code on one page http://www.admataz.com/library/scrollboxes.html
>I also started testing ways of accessing the style properties of divs:
>ad (capetown, ZA)
>For unsubscribe and other options, including
>the Tip Harvester and archive of TheList go to:
>http://lists.evolt.org Workers of the Web, evolt !

More information about the thelist mailing list