Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Javascript > scrollTo only if horizontal scrollbar

Reply
Thread Tools

scrollTo only if horizontal scrollbar

 
 
anna
Guest
Posts: n/a
 
      04-17-2004
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
 
Reply With Quote
 
 
 
 
anna
Guest
Posts: n/a
 
      04-26-2004
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.pageY Offset)"><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.bod y.scrollTop)"><img
src="/icons/redarrow.gif" border=0 alt="Scroll right"><img
src="/icons/redarrow.gif" border=0 alt="Scroll right"></a>');
}
}
 
Reply With Quote
 
 
 
 
Thomas 'PointedEars' Lahn
Guest
Posts: n/a
 
      04-27-2004
anna wrote:

> [nonsense again]


See <news:(E-Mail Removed)>


PointedEars
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
window.scrollTo sri_san@mailcity.com Javascript 0 04-13-2007 06:45 PM
Some help with scrollTo please? junk419@houston.rr.com Javascript 5 04-30-2006 12:21 AM
crazy scrollTo z Javascript 0 04-06-2004 04:18 PM
scrollTo doesn't work Simon Wigzell Javascript 0 02-15-2004 08:52 PM
automated scrollTo() problem Bob Kistler Javascript 1 09-13-2003 02:56 AM



Advertisments