Reputation: 748
I am trying to show a loading image every time the page loads into the div but I don't see the loading image.
I tried this:
<img src="images/ajax-loader.gif" id="loading">
Jquery:
$('#content').fadeOut('fast', function(){
$('#loading').show();
$('#content').load("about.php", function(){
$('#content').fadeIn('slow');
$('#loading').hide();
});
});
Upvotes: 1
Views: 728
Reputation: 97
You have a missing quotation-mark in your jQuery, after about.php.
This is the revised jQuery:
$('#content').fadeOut('fast', function(){
$('#loading').show();
$('#content').load("about.php", function(){
$('#content').fadeIn('slow');
$('#loading').hide();
});
});
Upvotes: 0
Reputation: 1527
Keep your <img src="images/ajax-loader.gif" id="loading">
outside of #content
div.
Upvotes: 2