Método 1:
A cópia do código é a seguinte:
<script type = "text/javascript">
var obj = new Image ();
obj.src = "yourpicurl.jpg";
obj.onload = function () {// Este local pode ser escrito repetidamente.
document.getElementById ("mypic"). innnerhtml = "<img src = '"+this.src+"' />";
}
</script>
<div id = "mypic"> ONLOADING… </div>
Método 2:
A cópia do código é a seguinte:
<script type = "text/javascript">
var obj = new Image ();
obj.src = "yourpicurl.jpg";
obj.onReadyStateChange = function () {
if (this.readyState == "Complete") {// Este local pode ser escrito repetidamente.
document.getElementById ("mypic"). innnerhtml = "<img src = '"+this.src+"' />";
}
}
</script>
<div id = "mypic"> ONLOADING… </div>
Método 3:
A cópia do código é a seguinte:
<! Doctype html public "-// w3c // dtd xhtml 1.0 transitional // pt" "http://www.w3.org/tr/xhtml1/dtd/xhtml1-bransitional.dtd">
<html xmlns = "http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv = "content-type" content = "text /html; charset = utf-8" />
<title> unt intitulado Documento </title>
</head>
<Script Language = "javascript" src = "/js/jQuery-1.4.4.js" type = "text/javascript">
</script>
<Script Language = "JavaScript" type = "text/javascript">
<!-// var total; var curt = 0; $ (documento) .ready (function ()
{{
total = $ ("#Content IMG"). Comprimento;
$ ("#Content IMG"). cada (function () {var image = new Image ();
image.src = $ (this) .attr ('src');
if (image.complete) {
imageloaded ();
}
outro {
image.onload = imageLoaded;
}
});
});
função imageloaded () {
curt+= 1;
if (curt == total) {
$ ("#Content"). show ();
}} //->
</script>
</head>
<Body>
<div id = "content" style = "display: Nenhum;">
<img src = "" />
<img src = "" />
<img src = "" />
</div>
</body>
</html>