且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

jQuery的 - 等到背景图像已加载然后显示元素

更新时间:2022-06-25 23:37:09

我的插件, waitForImages ,允许您附加回调时图像已经加载。

My plugin, waitForImages, allows you to attach callbacks when images have loaded.

它支持在CSS中引用的图像。

It supports images referenced in the CSS.

$('#some-container').waitForImages({
    waitForAll: true,
    finished: function() {
        // Loaded all images referenced in CSS.
    }
});