Home > categories > Machinery & Equipment > Loaders > JavaScript/JQuery loader?
Question:

JavaScript/JQuery loader?

I have some content on my site that is in html and JavaScript. It takes a few seconds to load and I would like to know how to make/where to get a JavaScript loading function that will show an animated gif until the content is done loading. I want it to be something like this:javascript-this is the laod function or whatever();I put my content in here and it won't show until it's fully loaded.

Answer:

Make the Loading ... gif a part of your webpage, in a div or some such. Then create a javascript function that removes that gif when the loading is finished. that is, something like: <script function clearGif() { var load = document.getElementByID(loading); load.style.display = none; } </script <body onload=clearGif() <div id=loading<img src=url of image / </div remainder of web page </body

Share to: