EnexoOnoma
EnexoOnoma

Reputation: 8836

Problem on removing the class of jquery script after the content is loaded

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

Answers (1)

Brij
Brij

Reputation: 6122

Try

 $('#firstresult').empty().addClass('loading').load(val + '.php', function(){$('#firstresult').removeClass('loading'); });

Upvotes: 1

Related Questions