jQuery LazyLoad在滚动之前不会加载图像 [英] jQuery LazyLoad do not load images until scroll

查看:461
本文介绍了jQuery LazyLoad在滚动之前不会加载图像的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

jQuery LazyLoad不会在打开页面的可见部分加载图像,直到我滚动页面甚至1px为止.

jQuery LazyLoad doesn't load images in open page's visible part until I scroll page even on 1px.

滚动页面时一切正常

更新:

CoffeScript

CoffeScript

jQuery ->
   $("img.lazy").show().lazyload()
   $(window).resize()

但是$(window).resize()仅在页面加载后从浏览器的控制台中输入时才有用

But $(window).resize() helps only if i enter it from browser's console when page have loaded

推荐答案

您的图像必须设置了宽度和高度.

Your images must have width and height set.

这篇关于jQuery LazyLoad在滚动之前不会加载图像的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆