为什么我的一些 jQuery 在刷新页面之前才加载?

发布于 2024-10-02 02:29:52 字数 316 浏览 8 评论 0原文

遇到问题,页面上的某些脚本在刷新之前似乎无法加载。
该页面位于此处
第一个 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(4

白日梦 2024-10-09 02:29:52

在 Chrome 中也适用,尽管标题(例如“安装”)仅出现在 Firefox 中(仅供参考)。

Works for me as well in Chrome, though the headings (e.g., "Installations") only appear in Firefox FYI.

分開簡單 2024-10-09 02:29:52

我在 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.

痴情 2024-10-09 02:29:52

我似乎仍然无法解决这个问题,而且它绝对不能在多台机器上工作...

我认为这可能与主页首次加载时 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 中提取高度,但确保检测到高度的最佳方法是将高度作为选项传递。

例子:

.galleria({
    height: 400
});

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:

.galleria({
    height: 400
});
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文