Text Size
Sunday, May 20, 2012
Get a look down
Drupal >> Code snippets >> How to scroll to top page using simple javascript
Thursday, 09 February 2012 12:16

How to scroll to top page using simple javascript

Written by Nabil Sadki
Rate this item
(1 vote)

You can use this little snippet to scroll to the top of the page using javascript (in case you don't wan't to use html anchors)

1
2
3
<!-- The click on this link will take you to the top of the page -->
<!-- Place this link on the bottom of the page -->
<a href="#" onclick="window.scroll(); return false">Scroll to the top</a>
Last modified on Thursday, 09 February 2012 12:21
Nabil Sadki

Nabil Sadki

Hello, I am Nabyl, a Freelance web developer and a joomla addict. I have made many sites using the latter, but also patches for the core of this CMS. I like HipHop culture and world of warcraft. You can find find me on Twitter when i'm free...

Website: www.coins.ma E-mail: This e-mail address is being protected from spambots. You need JavaScript enabled to view it

Add comment



Usefull tricks