Is there a way to use AddClass in jQuery to add a class while a page and the assets are loading?
For example you could add a class of loading to the body tag.
You can’t use the DOM ready function can you?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Putting my comment as an answer so this question can be marked as answered…
Set the loading class in the html and then use
.removeClassto remove it once the document has finished loading.