[thelist] Javascript for 'to top' if page is long, otherwise not

Jeremy Weiss jweiss at cox-internet.com
Fri Nov 18 11:08:55 CST 2005

Instead of using javascript couldn't you just do something like
 <a name="top"></a>  at the top of the document and then place 
 <a href="#top">Back to top</a> everywhere you want the link?


----- Original Message ----- 
From: <john at johnallsopp.co.uk>
To: <thelist at lists.evolt.org>
Sent: Friday, November 18, 2005 10:34 AM
Subject: [thelist] Javascript for 'to top' if page is long, otherwise not

> Hi
> I'd like a 'top' link at the bottom of pages which are longer than a
> screen depth, but I'm not too hot with Javascript (more of a PHP typa
> guy) and I've just looked through my (reasonably extensive) notes and
> can't see what I need, which is, I think, a function to tell me
> whether a window has displayed its scrollbars or not.
> Ideally, my javascript would be:
> If (this page is displaying its scrollbars)
> {
>   print 'top' link;
> }
> Can anyone help me out with this?
> Along the teach a man to fish mallarky, if there's a resource you tend
> to turn to for such things I'd be grateful to hear of it.
> Cheers
> J

More information about the thelist mailing list