I load a page with ajax and I want main page to auto scroll to the beginning of loaded page. Here is the code I use:
html
<button class="btn btn-info btn-lg" type="button" id="photos"> <i class="fa fa-plus fa-5x"></i><br>Add Photo</button>
and at the bottom of the page I have this js code
$(document).ready(function(){
$("#photos").click(function(){
$(".content-loader").fadeOut('slow', function()
{
$(".content-loader").fadeIn('slow');
$(".content-loader").load('somepage.php?pid=3');
});
});
The above works fine and page 'somepage.php?pid=3' is loaded in
<div class="content-loader">
.
How can I make the page to autoscroll to <div class="content-loader">
when page 'somepage.php?pid=3' is loaded?