小编thi*_*ier的帖子

如何在延迟加载图像后触发事件?

我有需要绝对定位的图像,以便图像的中心位于其父div的中心.我已经有了执行此操作的代码.

我最近添加了Lazy Load插件,它按预期工作.但是我需要一种延迟加载加载淡入图像触发我的图像居中代码的方法.

我目前的代码基本上是这样的:

jQuery(document).ready( function($) {

// Make all lazy images ready to load themselves and listen for a custom event
$("img.lazy").lazyload({ event:"delayed-lazy-load-event", effect : "fadeIn"});

});


// Wait for the iframes and other important junk to finish loading
jQuery( window ).load( function($){

// trigger lazy loading of thumbnails.
$("img.lazy").trigger("delayed-lazy-load-event")
}
Run Code Online (Sandbox Code Playgroud)

我找不到任何关于Lazy Load的任何功能的信息,它允许我设置一个回调函数在运行fadeIn效果后运行.

jquery jquery-lazyload

7
推荐指数
1
解决办法
8714
查看次数

标签 统计

jquery ×1

jquery-lazyload ×1