jquery顯示loading圖片直到網(wǎng)頁加載完成的方法
更新時(shí)間:2015年06月25日 12:27:27 作者:不吃皮蛋
這篇文章主要介紹了jquery顯示loading圖片直到網(wǎng)頁加載完成的方法,涉及jquery頁面加載與動(dòng)畫效果的使用技巧,需要的朋友可以參考下
本文實(shí)例講述了jquery顯示loading圖片直到網(wǎng)頁加載完成的方法。分享給大家供大家參考。具體實(shí)現(xiàn)方法如下:
<!DOCTYPE html> <html class="no-js"> <head> <meta charset='UTF-8'> <title>Simple Loader</title> <style> /* This only works with JavaScript, if it's not present, don't show loader */ .no-js #loader { display: none; } .js #loader { display: block; position: absolute; left: 100px; top: 0; } </style> <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.5.2/jquery.min.js"></script> <script src="https://github.com/Modernizr/Modernizr/raw/master/modernizr.js"></script> <script> // Wait for window load $(window).load(function() { // Animate loader off screen $("#loader").animate({ top: -200 }, 1500); }); </script> </head> <body> <img src="download.png" id="loader"> <img src="http://farm6.static.flickr.com/5299/5400751421_55d49b2786_o.jpg"> </body> </html>
希望本文所述對大家的jquery程序設(shè)計(jì)有所幫助。
相關(guān)文章
淺談DOCTYPE對$(window).height()取值的影響
下面小編就為大家?guī)硪黄獪\談DOCTYPE對$(window).height()取值的影響。小編覺得挺不錯(cuò)的,現(xiàn)在就分享給大家,也給大家做個(gè)參考。一起跟隨小編過來看看吧2016-07-07jQuery 利用$.ajax 時(shí)獲取原生XMLHttpRequest 對象的方法
這篇文章主要介紹了jQuery 利用$.ajax 時(shí)獲取原生XMLHttpRequest 對象的方法,非常不錯(cuò),具有參考借鑒價(jià)值,需要的朋友可以參考下2016-08-08