I have a scrollTop function in jQuery but I can't animate it. Is it possible?
$(".loadmore").click(function() {
$(this).toggleClass("up-arrow", 1000);
$(window).scrollTop($('.docs').offset().top, 2000);
});
I have a scrollTop function in jQuery but I can't animate it. Is it possible?
$(".loadmore").click(function() {
$(this).toggleClass("up-arrow", 1000);
$(window).scrollTop($('.docs').offset().top, 2000);
});
You can use
animate()
for this.Example code applied on a
div
is as follows :Demo can be found here : http://jsfiddle.net/codebombs/GjXzD/
Try this code of Jquery