Tuesday, September 27, 2011

Smothly Go On Top With Hep of Jquery

Hello Friends

Today I bring for you how could you go on top of the page smoothly.
here is small piece of code just put it in head of your page and call the function.
{ src="http://code.jquery.com/jquery.js">}{/script>}
{ language="javascript">}{ function gotop(){ < $('html,body').animate({ scrollTop: $("#demo").offset().top}, 1000);}


after that just call that function on click event of the anchor link or button

Note - Here #demo is the div id. Write the bigger test inside of this div including id put link out side of the div and just see the MAGIC. Replace {} with <>

1 comment: