I am using requireJS domReady plug in to show jQuery loading progress on asp.net web page.
Here is the code that I am using,
require(['domReady'], function (domReady) {
domReady(function () {
//Hide jQuery loading progress
});
//Show jQuery loading progress
});
Problem: jQuery loading progress is showing good, but it will only start after HTML controls loaded on the page. Behind the scenes some java script are still being loaded.
Once the HTML (for example a button) loaded, the jQuery loading progress stars and dis-appears after all the libraries are loaded. I want to show jQuery loading progress as soon as a page is requested. Any suggestions?
You can use the jQuery onload function:
And the
preLoad
class will be on your element/gif that displays as the page is loading, and after it's finished loading, it will displayafterLoad
In your CSS, you would have:
In your HTML you would have:
And the preLoad/afterLoad classes would get applied after and before the page loads, and what's contained in each depends on what you want to see.