JS implements the loading progress bar when the page is loaded
How to implement loading when the page is loaded
The loading implementation probably means this. First, hide the content to be displayed, first display the loading text or pictures, and then add the content after the document is loaded. Just show it and hide the loading.
I used jquery here, it doesn’t matter whether I use it or not.
<html> <head> <script language="javascript" type="text/javascript" src="jquery-1.6.1.js"> </script> /** * 页面加载完成后显示页面 */ function showPage(){ $('#divPageLoading').remove(); $('#divPageBody').show(); } </head> <body onload="showPage();"> <div id="divPageLoading"> <img src="pageloading.gif" style="width:120px;height:120px;position:absolute;left:45%;top:40%;"/> </div> <div id="divPageBody" style="display:none;"> …… </div> </body> </html>
For more related articles on JS implementation of loading progress bar when loading pages, please pay attention to the PHP Chinese website!