Hello
I want to display a link on the bottom of a webpage to go to the top,
but only if the user has to scroll down. If there's a small page, this
link has no use.
I'm using the following code (in the body onload)
var wdb = window.document .body;
var scrolling;
if (wdb.scrollHeig ht > wdb.clientHeigh t) {
//alert('Scrollin g=True');
document.getEle mentById('img_t otop').style.vi sibility
= 'visible';
}
else {
//alert('Scrollin g=False');
document.getEle mentById('img_t otop').style.vi sibility
= 'hidden';
}
It works on Internet Explorer, scrollHeight is bigger than clientHeight
with a long page.
But not in firefox, scrollHeight = clientHeight in all cases.
What can I do about it?
regards
Peter
I want to display a link on the bottom of a webpage to go to the top,
but only if the user has to scroll down. If there's a small page, this
link has no use.
I'm using the following code (in the body onload)
var wdb = window.document .body;
var scrolling;
if (wdb.scrollHeig ht > wdb.clientHeigh t) {
//alert('Scrollin g=True');
document.getEle mentById('img_t otop').style.vi sibility
= 'visible';
}
else {
//alert('Scrollin g=False');
document.getEle mentById('img_t otop').style.vi sibility
= 'hidden';
}
It works on Internet Explorer, scrollHeight is bigger than clientHeight
with a long page.
But not in firefox, scrollHeight = clientHeight in all cases.
What can I do about it?
regards
Peter
Comment