Save yourself all the trouble of building those "back to top" links all over your page and have a floating version instead. It's always at the bottom of your browser window and always links to the top of your page.
Please Note: This script now comes in two forms, one for HTML pages using no DOCTYPE or a transitional DOCTYPE and one version for strict DOCTYPE. The zip file contains both versions.
There are 3 things you can easily modify in this script. they are all on the first line.
This sets the horizontal position of the Bak2Top link, puts the link 80 pixels in from the right hand side of the browser window.
This sets the vertical position of the Bak2Top link, puts the link 50 pixels up from the bottom of the browser window.
- b2th='<nobr>Back To Top</nobr>'
This contains the HTML to be displayed as your Bak2Top link. You can change the HTML between the single quotes (') to anything you like. This means you could use an image as your link.
e.g. b2th='<img src="bak2top.gif">'
- Download bak2top.zip and unpack the files.
- Copy bak2top.js to your web site.
- Add the following line within the <BODY> tags on the page(s) you want to have the link:
- Change "pathto/bak2top.js" to point to the location of bak2top.js
- Installation Complete!