Scroll to Top - jQuery powered web browsing
Scroll to Top - jQuery powered web browsing
As an internet “browsoholic” I always encounter websites with huge pages that are really annoying when it comes to scrolling back to the main menu at the top of the page. ‘course I could easily press the “Home” button on my keyboard, but that requires my right hand that’s always on the mouse when I’m not typing.
The best tool that I found so far, provided by www.dynamicdrive.com can be integrated in your pages in less than a minute.
«Scroll down to see it in action»
Add the script below to the <HEAD> section of your page:
<script type=”text/javascript” src=”http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js”></script>
<script type=”text/javascript” src=”scrolltopcontrol.js”>
/***********************************************
* Scroll To Top Control script- © Dynamic Drive DHTML code library (www.dynamicdrive.com)
* This notice MUST stay intact for legal use
* Visit Project Page at http://www.dynamicdrive.com for full source code
***********************************************/
</script>
Download scrolltopcontrol.js
Downlod icon provided by DynamicDrive : ![]()
Because this is a free script, you’ll have to include the legal notice too.
Important Note: Your page should contain a valid doctype at the very top in order for this script to work as intended.Ex:
<!DOCTYPE html PUBLIC “-//W3C//DTD XHTML 1.0 Transitional//EN”“http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd”>
<html xmlns=”http://www.w3.org/1999/xhtml” lang=”en” xml:lang=”en”>
You can customize a variety of things, such as the amount of time it takes the script to scroll back up to the top, duration of the fade in/out effect for the control, and the number of pixels the user’s scrollbar should be from the top of the page before revealing the control. Look inside scrolltopcontrol.js.
For the most lazy - here are some simple images that you can use for the Scroll to Top Button
If you don’t have a hosting account, you can link these images to the script. They are permanent links, but it would be better if you save a copy on your hard drive.

