Click here to Skip to main content
15,900,906 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi all
I have a long html page,I want to create a button which move according to page move and when we click on it we are on top of the page.
Posted

You can use CSS position: fixed to keep an element visible: http://www.w3schools.com/cssref/pr_class_position.asp[^]

To go back to the top of the page, use a link like this:
<a href="#main">Top of page</a>

Replace 'main' with the ID of an element that starts at the top of your page.
 
Share this answer
 
You will handle this problem with only using CSS techniques :

http://www.digimantra.com/technology/css/create-fixed-side-buttons-feedback/[^]

To embed a go to top link read this page:

http://www.bennadel.com/blog/822-Using-BODY-ID-As-A-Back-To-Top-Page-Anchor.htm[^]

In case you wanted to use JQuery :
http://davidwalsh.name/scrolling-link[^]


Hope it helps.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900