Move browser window down to div position when it loads ajax and jQuery

I have a div into which I dynamically load ajax, jquery data. as

$('#wp').load('http://someurl.com/getit',p,function(str){} );

Now, since I have a page with data before this div, I need to move the browser window down to that place of the div after it is loaded with slow motion, similar to similar effects in stackoverflow. Please help me. Thanks in advance.

+3
source share
1 answer

try this plugin: http://flesler.blogspot.com/2007/10/jqueryscrollto.html

Once you have uploaded your content in the DIV, call

$. scrollTo ( "# your-div-id-here", {duration: 1000});

.

+4

Source: https://habr.com/ru/post/1719888/


All Articles