To add this effect, first figure out the loading of the page and the sequence of event execution, see this simple example:
Execution Result: 9 rows >14 rows >11 rows, 9 lines of code placed in different positions, the result remains the same. To understand the above order, if you want to let the page before loading display jquery Mobile loader, and then the page data request execution, pictures and other multimedia after loading, and then close the loader, you can follow the following ideas to solve:
Description
1) 9 lines of code to be slightly delayed execution, otherwise it is possible to refer to the JS file has not been loaded, this time call Showloader method, is not correctly executed, can not show the loader
2 shutdown loader can be placed in Document.ready or window.onload, specifically to see the implementation of the page needs.
3 If the speed is fast enough, two pictures in an instant load complete, it may not see the obvious loader display and shutdown process.
The above is a small set to introduce the jquery mobile in the page load add load effect Document.ready and window.onload execution order comparison, hope to help everyone, if you have any questions please give me a message, small series will promptly reply to everyone. Here also thank you very much for the cloud Habitat Community website support!