<html> <title> Imagem Preload </ititle> <body> <cript> // Browser Judge var VAR Browser = novo Object (); navegador.UserAgent = window.navigator.userAgent.tolowerCase (); navegador.ie =/msie/.test (navegador.userAgent); navegador.moz =/gecko/.test (Browser.UserAgent); var iMg = new Image (); if (Browser.ie) {img.onReadyStateChange = function () {if (img.readyState == "complete" || img.readyState == "carregado") {retorno de chamada (img, imgid); }}} else if (Browser.moz) {img.onload = function () {if (img.complete == true) {retorno de chamada (img, imgid); }}}} // Se ocorrer uma exceção devido à rede ou imagem, a imagem será exibida img.onerror = function () {img.src = 'http: //www.baidu.com/img/baidu_logo.gif'} img.src = val; checkImg (obj, imgid) {document.getElementById (imgid) .src = obj.src;} // inicialize a imagem a ser exibida e especifique a janela de localização de exibição.onload = function () { Imagess ("http://hiphotos.baidu.com/lovebyakuya/pic/item/01cf20088f9506f063d98653.jpg", "img1", checkImg); Imagess ("http://hiphotos.baidu.com/lovebyakuya/pic/item/7b7b19c70d62f4fdd0006050.jpg", "img2", checkImg); Imagess ("http://hiphotos.baidu.com/joanne728/pic/item/892557641806d20eaaa184c71.jpg", "img3", checkImg); Imagess ("http://www.neocha.com/-/res/camilla/20071204181216078845_h.jpg", "img4", checkImg); Imagess ("http://www.neocha.com/-/res/camilla/20071204181216d078845_h.", "Img5", checkImg);} </sCript> <img id = "img1" src = "carreging.gf"/> /> <img id = "img3" src = "loading.gif" /> <img id = "img4" src = "loading.gif" /> <img id = "img5" src = "loading.gif" /> < /body> < /html>