webkit browsers are getting elements.width() wrong

一个人想着一个人 提交于 2019-12-05 13:57:22

Are you calling this from

$(document).ready(...) ?

if so try using

$(window).load(...)

If you don't want to wait for the window load event, you could run it on each image's load event instead. As Gaby said in a comment, if you know the image's dimensions, adding width properties to your images would allow you to run it earlier.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!