I want to achieve an automatic scroll to the beginning of a loaded page after using ajax to load it. Here is the code snippet I currently have:
html
<button class="btn btn-info btn-lg" type="button" id="photos"> <i class="fa fa-plus fa-5x"></i><br>Add Photo</button>
Additionally, at the bottom of the page, there is this block of javascript:
$(document).ready(function(){
$("#photos").click(function(){
$(".content-loader").fadeOut('slow', function()
{
$(".content-loader").fadeIn('slow');
$(".content-loader").load('somepage.php?pid=3');
});
});
The current setup successfully loads 'somepage.php?pid=3' into
<div class="content-loader">
.
How can I implement an autoscroll to <div class="content-loader">
once the content has been loaded?