Reputation: 2481
I would like to slide my page only after it fully loads. I use
href="page#a"
and
href="page#b"
however, sections a and b's initial position is not the final position. my page loads charts and data from SPs and it takes a few seconds, making divs a and b go to the lower part of the page. Thanks.
Upvotes: 0
Views: 47
Reputation: 5622
Write your code inside .load()
$( window ).load(function() {
//whatever you write here will get executed when the page is fully loaded
$.ajax({
dataType: 'json',
beforeSend : function() {
console.log('Before Ajax Request Starts !!');
},
success: function(data) {
/*__YOUR CODE GOES HERE
AFTER PAGE LOADS AND AJAX COMPLETES LOADING_
_____code for sliding ______
*/
}
});
});
Upvotes: 2
Reputation: 3429
you can try this one:
$(document).ready(function(){ ... });
or
$(window).load(function(){ ... });
Upvotes: 0