CSS 背景图像完全加载时的 JQuery 绑定事件
我想在背景图像完全加载后触发一个事件。 该图像是由动态 PHP 脚本制作的。
$("#box").css("background-image","url(image.php)");
也许我可以尝试在不可见的
中获取图像,并在图像加载时 (.load()) 使用不可见的
的 src 设置背景图像?不确定...
谢谢你的帮助。
I would like to trigger an event after a background-image is FULLY loaded.
The image is made from a dynamic PHP script.
$("#box").css("background-image","url(image.php)");
maybe I can try to get the image in a invisible <img>
and when the image load (.load())
set the background-image with the src of that invisible <img>
? not sure...
thank you for your help.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您可以使用我的名为 waitForImages 的 jQuery 插件,这将有助于解决此问题...
否则,请手动执行此操作。 ..
You could use my jQuery plugin called waitForImages that would help with this...
Otherwise, to do it manually...