Jquery Go To Top

Where to use

Hi it very useful thing for content based website like new portal or tutorials portal, if a page has more content, user is now in the bottom of the page if he wants to go top of the page by the time it will help. Even it is user-friendly also so use it make attractive just follow the step understand and use it.

Jquery Code

Here some jquery example code with id and events with functions, we have button (#gotop) with click event, when user clicks on Go To Top button total document scroll (with animation)top ("0px").

Just observe the code, code will demonstrate.
$("html, body").animate({
scrollTop: "0px" }, 800);

HTML code

HTML code with to div elements one is for content (forcontent) and remine is for button (Go To Top).

<div id="forcontent">Enter text here about your business</div>
<div id="gotop">Top</div>

Css code

border:1px solid #000;