方法1:
コードコピーは次のとおりです。
<script type = "text/javascript">
var obj = new Image();
obj.src = "yourpicurl.jpg";
obj.onload = function(){//この場所は繰り返し書くことができます。
document.getElementById( "mypic")。innnerhtml = "<img src = '"+this.src+"' />";
}
</script>
<div id =” mypic”>オンロード…</div>
方法2:
コードコピーは次のとおりです。
<script type = "text/javascript">
var obj = new Image();
obj.src = "yourpicurl.jpg";
obj.onreadystatechange = function(){
if(this.readystate == "Complete"){//この場所は繰り返し書くことができます。
document.getElementById( "mypic")。innnerhtml = "<img src = '"+this.src+"' />";
}
}
</script>
<div id =” mypic”>オンロード…</div>
方法3:
コードコピーは次のとおりです。
<!doctype html public " - // w3c // dtd xhtml 1.0 transitional // en" "http://www.w3.org/tr/xhtml1/dtd/xhtml1-transitional.dtd">
<html xmlns = "http://www.w3.org/1999/xhtml">
<head>
<Meta http-equiv = "content-type" content = "text /html; charset = utf-8" />
<title> un unt ittitled document </title>
</head>
<スクリプト言語= "javascript" src = "/js/jquery-1.4.4.js" type = "text/javascript">
</script>
<スクリプト言語= "javascript" type = "text/javascript">
<! - // var total; var curt = 0; $(document).ready(function()
{
Total = $( "#content img")。length;
$( "#content img")。各(function(){var image = new Image();
Image.src = $(this).attr( 'src');
if(image.complete){
ImageLoaded();
}
それ以外{
image.onload = imageloaded;
}
});
});
function imageLoaded(){
curt+= 1;
if(curt ==合計){
$( "#content")。show();
}} //->
</script>
</head>
<body>
<div id = "content" style = "display:none;"
<img src = "" />
<img src = "" />
<img src = "" />
</div>
</body>
</html>