Click to See Complete Forum and Search --> : Netscape 7 & DIV Clipping


FragMaster B
11-12-2003, 04:55 PM
Hi all. I've got this funky problem that I can't seem to figure out. I have a need to dynamically create a DIV and then return its width. Doing this is all fine and dandy UNTIL I try to return the width via "offsetWidth" in NS7 when the div is created of the edge of the window. NS 7 clips it for some reason.

Run the following script in NS7 and you'll see what I mean.

Is there a clip property or something that I can access to retrive the TRUE width?


<html>
<head>
<title>Netscape Sux</title>
<script language="JavaScript" type="text/JavaScript">
function CreateDIV(WindowSize){

if (WindowSize==1){window.resizeTo(525,400)}
else if (WindowSize==2){window.resizeTo(700,400)}

var oHL = document.createElement("DIV")
oHL.style.position = "absolute"
oHL.style.top = "100px"
oHL.style.left = "490px"
oHL.style.height = "20px"
oHL.style.backgroundColor = "red"
oHL.innerHTML = "&nbsp;&nbsp;Dynamagical layer&nbsp;&nbsp;"
oHL.style.color = "white"
document.body.appendChild(oHL)

alert("The new DIV has an offsetWidth of " + oHL.offsetWidth)
}
</script>
</head>

<body>

<a href="javascript:CreateDIV(1)">Create DIV on the edge of the viewable window.</a>
<br>
<a href="javascript:CreateDIV(2)">Create DIV in the viewable window.</a>

</body>
</html>