scrollTo only if horizontal scrollbar

A

anna

How to tell if a horizontal scrollbar is present? I only want to use
scrollTo if horizontal scrollbar is present.

window.scrollbars.visibility doesn't specify which scrollbar is
present, so it gives a false result if there is vertical scrollbar but
not horizontal scrollbar.

TIA,
Anna
 
A

anna

FOLLOWUP


if (navigator.appName.indexOf("Netscape") != -1 &&
parseFloat(navigator.appVersion) < 5 ) {
if (document.width > window.innerWidth) {
document.write('<a
href="javascript:window.scrollTo(1000,window.pageYOffset)"><img
src="/icons/redarrow.gif" border=0 alt="Scroll right"><img
src="/icons/redarrow.gif" border=0 alt="Scroll right"></a>');
}
} else {
if (document.body.scrollWidth > document.body.clientWidth) {
document.write('<a
href="javascript:window.scrollTo(1000,document.body.scrollTop)"><img
src="/icons/redarrow.gif" border=0 alt="Scroll right"><img
src="/icons/redarrow.gif" border=0 alt="Scroll right"></a>');
}
}
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,482
Members
44,900
Latest member
Nell636132

Latest Threads

Top