📜  图像加载上的 javascript - Javascript 代码示例

📅  最后修改于: 2022-03-11 15:01:16.388000             🧑  作者: Mango

代码示例1
window.onload = function () {

        var logo = document.getElementById('sologo');

        logo.onload = function () {
            alert ("The image has loaded!");        
        };

        setTimeout(function(){
            logo.src = 'https://edmullen.net/test/rc.jpg';         
        }, 5000);
    };