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

john at johnallsopp.co.uk john at johnallsopp.co.uk
Fri Nov 18 11:25:36 CST 2005


Hi Jeremy

Yes, but that would mean editing each page where I want it, and being
worried about it if I change the length of the page. I wanted
something that would, if I added an extra paragraph that took it
overlong, add the link automatically. Goal: easy life.

Actually, I started making a footerBig version of the footer which
would have required me to insert the former rather than the latter if
the file became big, but the problems the same, which is why I wrote
to you nice ppl.

What's more, I'm going to do it again, ha ha!

J

> 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?
>
> -jeremy
>
> ----- 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
>
> --
>
> * * Please support the community that supports you.  * *
> http://evolt.org/help_support_evolt/
>
> For unsubscribe and other options, including the Tip Harvester
> and archives of thelist go to: http://lists.evolt.org
> Workers of the Web, evolt !
>




More information about the thelist mailing list