Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

div - scrollHeight - Netscape

Status
Not open for further replies.

KryptoS

Programmer
Feb 7, 2001
240
BE
Hey, I have this code, the disclaimer-div is shown at the buttom off every page. But this doesn't work with netscape. Can someone help me with this?


<script>
function positionDisclaimer()
{
disclaimer.style.top = document.body.scrollHeight - disclaimer.offsetHeight;
}
</script>

<body onload='positionDisclaimer()'>
....
<div id='disclaimer' style='position:absolute; bottom: 0; width:98%; left: 1%'>just something here
</div>

The One And Only KryptoS
 
Do you need the function at all? It seems that absolute positioning and bottom: 0; would position it perfectly.

--Chessbot

"In that blessed region of Four Dimensions, shall we linger on the threshold of the Fifth, and not enter therein? Ah, no! [...] Then, yielding to our intellectual onset, the gates of the Sixth Dimension shall fly open; after that a Seventh, and then an Eighth -- --" Flatland, A. Square (E. A. Abbott)
 
isn't absolute position and bottom:0 for just showing the div at the bottom of the page when the content of the page isn't larger then your screem. The javascript function show the div at the bottom of the page when your page is larger then your screen (and you get a scrollbar).

The One And Only KryptoS
 
Just found the solution, for those who are interested:

document.getElementById('disclaimer').style.top = document.body.scrollHeight - document.getElementById('disclaimer').offsetHeight // netscape

The One And Only KryptoS
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top