Home » ★JavaScriptリファレンス

★JavaScriptリファレンス

document.イメージ名.complete …… 画像の読み込みが完了したかどうかを返す
Internet Explorer
Google Chrome
Safari
Firefox
Opera
広告



イメージオブジェクトのcompleteプロパティは、画像の読み込みが完了したかどうか真偽値を返します。

■使用例

HTML + JavaScriptソース

<p>
<img name="samplepanda1" src="https://htmqcom1.wpengine.com/wp-content/uploads/2024/07/panda1.gif"><br>
<button type=button onclick="alert(document.samplepanda1.complete)">読み込み確認</button>
</p>

↓↓↓

ブラウザ上の表示


■関連項目

document.images.length …… ドキュメント内にある画像の数を参照する
document.イメージ名.src …… 画像ファイルのURLを参照する
document.イメージ名.lowsrc …… 低解像度画像ファイルのURLを参照する
document.イメージ名.name …… 画像のname属性の値を参照する
document.イメージ名.complete …… 画像の読み込みが完了したかどうかを返す
document.イメージ名.width …… 画像の横幅を設定する
document.イメージ名.height …… 画像の高さを設定する
document.イメージ名.hspace …… 画像の水平方向の余白を設定する
document.イメージ名.vspace …… 画像の垂直方向の余白を設定する
document.イメージ名.border …… 画像のボーダーの太さを設定する
広告



Lorem Ipsum is simply dummy text

    By signing up, you agree to our Terms and Privacy Policy. Unsubscribe anytime.