Jquery scrollTo not working

I am just trying to navigate to a specific DOM element or absolute position in my browser window and it does not work. Here is my code:

$(window)._scrollable();
$('#scene_01_down').click(function(){
    $(window).scrollTo(2000,1000);
});

and here is the documentation for the plugin:

http://flesler.blogspot.com/2007/10/jqueryscrollto.html

+5
source share
1 answer

Do you really need this plugin?

$("html,body").animate({
    scrollTop: 2000,
    scrollLeft: 1000
});

To go to a specific item:

var offset = $("#someElement").offset();
$("html,body").animate({
    scrollTop: offset.top,
    scrollLeft: offset.left
});

Demo

+22
source

All Articles