I’m working on a site which contains a whole bunch of mp3s and images, and I’d like to display a loading gif while all the content loads.
I have no idea how to achieve this, but I do have the animated gif I want to use.
Any suggestions?
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.
Typically sites that do this by loading content via ajax and listening to the
readystatechangedevent to update the DOM with a loading GIF or the content.How are you currently loading your content?
The code would be similar to this:
There are plenty of 3rd party javascript libraries that may make your life easier, but the above is really all you need.