I'm trying to animate while scrolling but no luck with my code...
I have this jquery
$(window).scrollTop(200);
Now wanted to give animation effect
So tried these but not working:
1. $(window).animate({scrollTop:200},1000);
2. $('body').animate({scrollTop: 200}, 1000);
I have applied this in a click function like this:
$('.goto').click(function(){
$(window).scrollTop(485); // its working
});
And now I want to give effect of animate but not working...
animate
on$(window)
. Use$('html,body')
instead. JSFiddle – Eve