Reputation: 8836
I have the following code that gets the value of a drop down list and displays the value.php and valueb.php files in different divs. I already added a loading class, but I can't remove it when the page is loaded.
I tried .removeClass('loading')
before the end of statement with no result (when i add the removeclass, the pic is not loading).
The follow displays the loading pic onChange and stays showing. Thank you.
$('#result').empty().addClass('loading').load(val + '.php');
Upvotes: 0
Views: 103
Reputation: 6122
Try
$('#firstresult').empty().addClass('loading').load(val + '.php', function(){$('#firstresult').removeClass('loading'); });
Upvotes: 1