为什么我的一些 jQuery 在刷新页面之前才加载?
遇到问题,页面上的某些脚本在刷新之前似乎无法加载。
该页面位于此处。
第一个 iframe(单击图像最左侧)在手动刷新 iframe 之前不会加载 Galleria 插件。另外,尽管包含 $(document).ready(function(){ ,但主页上的 qTip 脚本通常表现相似。
所以,我的问题是,如何停止这种行为,或者让 iframe 自动重新加载 onload 一次?
谢谢!
Having a problem where some of the scripts on my page don't seem to load until refresh.
The page is here.
The first iframe (click far left-hand side of image) doesn't load the Galleria plug-in until the iframe is manually refreshed. Also, the qTip script on the main page often behaves similarly, despite $(document).ready(function(){ being included.
So, my question is, how can I stop this behaviour, or have the iframe automatically reload onload once?
Thanks!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
在 Chrome 中也适用,尽管标题(例如“安装”)仅出现在 Firefox 中(仅供参考)。
Works for me as well in Chrome, though the headings (e.g., "Installations") only appear in Firefox FYI.
我在 Safari 5 上工作得很好(不需要重新加载)。可能是缓存问题。尝试使用缓存清除,也许会有帮助。
Works fine for me on Safari 5 (no reloads required). Could be a caching problem. Try using cache-busting, maybe it will help.
我似乎仍然无法解决这个问题,而且它绝对不能在多台机器上工作...
我认为这可能与主页首次加载时 iframe 位于隐藏的 div 中有关。我读到了一些关于使用“左偏”技术的内容,但不知道如何实现这一点。
I still can't seem to fix this, and it's definitely not working on multiple machines...
I think it may be to do with the iframes being in hidden divs when the main page first loads. I read something about using the "off-left" technique instead, but not sure how to implement this.
您可能应该将高度作为选项传递,Gallerie 尝试从 css 中提取高度,但确保检测到高度的最佳方法是将高度作为选项传递。
例子:
You should probably pass height as an option, Gallerie tried to extract the height from your css, but the best way to make sure a height is detected is by passing height as an options.
example: