return to top link without bookmark

i saw this on leslie’s site. i never thought of it before. the conventional way to do a “return to top” link is create a bookmark with:
<a name="top"></a>

at the top of the page and then use:
<a href="#top">Return to Top</a>
to link it.

well there’s an easier way. this only works if you want to return to the very top of the page. it obviously does not replace the functionality of bookmarks.

<a href="#" onclick="window.scrollTo(0,0);return false;">Return to Top</a>

Since the latter one uses javascript therefore it will not work on browsers with javascript disabled.


3 Comments Leave a Comment

Jenny [ Quote ]

look what i found: http://bluesplash.blogspot.com someone has your name!

btw: thats a really cool tip. i think i’ll use it on my blog. :) thnx.

February 25th, 2005 at 4:08 pm
Kyla [ Quote ]

wow, that can come in handy, i regret adding 1000’s of back to top’s the old way now. haha. I’ve been a fan of your page forever, i love it :)

February 25th, 2005 at 5:25 pm
Dayna [ Quote ]

Hey, thanks for that.. it works realy well.. I’m using it on my site now.. hehe… thank god I only have to edit only one file to change that.. or I will be (O.o)”"

February 26th, 2005 at 3:09 am

Leave a Comment Name, email and comment are required.
Email will never be displayed.

Leave a Comment
  1. :biggrin: :blank: :blush: :bored: :confused: :cool: :down: :evil: :frown: :grin: :grr: :laidback: :left: :mad: :right: :sad: :secret: :shock: :smile: :stress: :tongue: :up: :wink: :yawn: :cute: :dead: :film: :floppy: :glasses: :grumpy: :headphones: :heart: :lightbulb: :ouch: :tv: :upsidedown: :vodka: :yell: :yuck: :yummy: