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

Christian Heilmann codepo8 at gmail.com
Fri Nov 18 12:02:52 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!

There is the window.scrollbars.visible attribute which should be false
and true according to the specs, but firefox always tells me it is
true and MSIE does not allow it on non-popups at all.

You could read the height of the browser and compare it with the
height of the main elements and display the backto link when the
latter is bigger than the former.

However, this is a lot of work for some functionality users are not
likely to recognise or need anyways.


--
Chris Heilmann
Blog: http://www.wait-till-i.com
Writing: http://icant.co.uk/
Binaries: http://www.onlinetools.org/



More information about the thelist mailing list