<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta http-equiv="X-UA-Compatible" content="ie=edge"> <title>jquery实现简单网页进度条</title> <style> * { margin: 0; padding: 0; } .loading { width: 100%; height: 100%; background: #fff; position: fixed; top: 0; left: 0; z-index: 999; } img { width: 100%; } .loading .pic { width: 200px; height: 100px; background: url(img/07.gif) no-repeat center; position: absolute; top: 0; left: 0; right: 0; bottom: 0; margin: auto; } </style> </head> <body> <p class="loading"> <p class="pic"></p> </p> <!-- 页面加载完成后要展示的图片 --> <img src="http://www.qiye800.com/skin/default/image/lazy.gif" class="lazy" original="http://www.qiye800.com/skin/default/image/nopic.gif" alt=""> <img src="http://www.qiye800.com/skin/default/image/lazy.gif" class="lazy" original="http://www.qiye800.com/skin/default/image/nopic.gif" alt=""> <img src="http://www.qiye800.com/skin/default/image/lazy.gif" class="lazy" original="http://www.qiye800.com/skin/default/image/nopic.gif" alt=""> </body> <script> document.onreadystatechange = function () { if (document.readyState == "complete") { //判断状态 $(".loading").fadeOut(); } } </script> </html>
相关推荐:
js编写网页进度条实例方法
有关网页进度条的文章推荐
javascript 网页进度条简单实例
以上就是JS实现网页进度条简单代码分享的详细内容,更多请关注php中文网其它相关文章!