<html> <itle> Image Précharge </Title> <body> <Script> // juge Browser var Browser = new Object (); Browser.UserAgent = Window.Navigator.UserAgent.TolowerCase (); Browser.ie = / MSIE / .Test (Browser.Userager); Browser.Moz = / Gecko / .Test (Browser.Usergerrent); // Jugez si le chargement est complété l'image de fonction (url, imgid, rappel) {Vars var img = new image (); if (Browser.ie) {img.onreadystateChange = function () {if (img.readystate == "complet" || img.readystate == "chargé") {callback (img, imgid); }}} else if (Browser.moz) {img.onload = function () {if (img.complete == true) {callback (img, imgid); }}}} // Si une exception se produit en raison du réseau ou de l'image, l'image est affichée img.onerror = function () {img.src = 'http: //www.baidu.com/img/baidu_logo.gif'} img.src = val;} // affiche la fonction de l'image checkImg (obj, imgid) {document.getElementById (imgid) .src = obj.src;} // Initialisez l'image à afficher et spécifiez la fenêtre d'emplacement d'affichage.onload = function () {{ IMAMESS ("http://hiphotos.baidu.com/lovebyakuya/pic/item/01cf20088f9506f063d98653.jpg", "img1", checkImg); Imageess ("http://hiphotos.baidu.com/lovebyakuya/pic/item/7b7b19c70d62f4fdd0006050.jpg", "IMG2", CheckImg); Imageess ("http://hiphotos.baidu.com/joanne728/pic/item/892557641806d20eaaa184c71.jpg", "img3", checkImg); IMAMESS ("http://www.neocha.com/-/res/camilla/20071204181216078845_h.jpg", "img4", vérification); IMAMESS ("http://www.neocha.com/-/res/camilla/20071204181216d078845_h.", "Img5", checkImg);} </ script> <img id = "img1" src = "loading.gif" /> <img id = "img2" src = "lourde. id = "img3" src = "Loading.gif" /> <img id = "img4" src = "charging.gif" /> <img id = "img5" src = "charging.gif" /> </ body> </ html>