Tag: window

Scroll window smoothly using jQuery

26th March

Using jQuery animate() function to do a smooth scrolling:

I have also created a div as follow:

<div id=”scrollToHere”>
Scroll to here

You need something to run your script. Create a button like this:

<input type=”button” onclick=”scollWin();” value=”Scroll up” />

The jQuery Code will be like this:

function scrollWin(){
scrollTop: $(“#scrollToHere”).offset().top
}, 800);

Here is something to try:

now jQuery window scrolling is done with animation.

Enjoy it..