PDA

View Full Version : offsetWidth value in netscape6


kdjoergensen
01-07-2001, 06:03 PM
Following work in netscape 6:
<div id="aa" style="position: absolute;"><div id="bb">Here is a layer</div></div>

var w = document.getElementById('aa').offsetWidth;
var w2 = document.getElementById('bb').offsetWidth;

However, if the nested layer (id="bb") is also set to position: absolute the width returned for both elements are ZERO.


<div id="aa" style="position: absolute"><div id="bb" style="position: absolute">Here is a layer</div></div>

var w = document.getElementById('aa').offsetWidth;
var w2 = document.getElementById('bb').offsetWidth;

above will return zero (0) for both elements.
Now, why would anyone in their right mind nest two absolutely positioned elements to begin with ? - I don't know, but that should still not affect the width of the element ?

Anyone have had similar experiences ?




[This message has been edited by kdjoergensen (edited 01-07-2001).]

Ian
01-07-2001, 07:49 PM
I recently downloaded NS6 to check through A1 javascripts for layout errors, (not what scripts work and what don't). Although A1 was pretty good, I think NS6 was not ready for release and is very buggy in the layout department, you may have just found one more example of that.

------------------
Ian

Web Development - BIG Resources Inc
Head Guide - 123Webmaster.com (http://www.123webmaster.com/)
ian@123webmaster.com
BIG Resources.com (http://www.bigresources.com)
ICQ: 25828668

kdjoergensen
01-07-2001, 10:16 PM
I would be nice if just for once we could refer to a netscape browser by another name than "good ol' buggy"... uhhh

I guess the rationale behind releasing netscape 6 before even the known bugs were corrected was to get it out there, get some exposure from the people with no life and then hopefully follow up with a more soild version within 60-90 days of first release.
I only hope for netscape's sake that they dont wait another 2 years to correct the main bugs. If so they may never get a 2nd chance ..
(keep hope alive !!)