IFrame Loaded 事件中的所有内容
是否有某种 IFrame 事件仅在每个资源(脚本、图像、样式表、dom)加载时触发?基本上我希望在 IFrame 上显示一个加载图形,并且仅在所有内容都加载到内部时才将其删除,这样用户就看不到所有内容正在加载。
目前我正在使用 $(iframe).ready(function() { ... });
但这会在加载任何内容之前很早就触发。
Is there some sort of event for IFrames that only fires when every resource (script, image, stylesheet, dom) has loaded? Basically I want to have a loading graphic displayed over the IFrame and only remove that when everything is loaded inside so the user doesn't see everything loading.
Currently I am using $(iframe).ready(function() { ... });
but this fires very early before anything has loaded.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您正在寻找
window.onload
事件。如果任何东西(图像、iFrame 等)完全加载,
window.onload
就会触发,这就是为什么大多数人非常不喜欢这个事件。但就你的情况而言,它似乎很合适。非 jQuery
You are looking for the
window.onload
event.window.onload
fires if anything (images, iFrames, etc.) was completly loaded, that is why most guys dislike this event pretty much. But in your case, it seems to fit.non-jQuery