jquery 选项卡重新加载

发布于 2024-08-06 11:09:52 字数 247 浏览 2 评论 0原文

我正在尝试找出如何按照我想要的方式加载选项卡。基本上,当有人访问我的页面时,我希望它创建 2 个选项卡(我正在工作)。现在,在每个选项卡中,我都有一个通过嵌入代码放置在那里的小部件(工作正常)。但是,当我从一个选项卡切换到另一个选项卡时,它会重新加载每个选项卡中的数据。假设我正在观看一个视频,当我切换到另一个视频时,它会停止视频,当我返回时,它会重新启动视频。有什么方法可以阻止它在加载选项卡后重新加载选项卡吗?我尝试将缓存设置为 true 但似乎没有修复它。任何帮助表示赞赏。

I am trying to figure out how to load the tabs the way I want. Basically when someone visits my page I want it to create 2 tabs(which I have working). Now inside of each of those tabs I have a widget that is put there through embed code (which is working fine). However, when I switch from one tab to another it is reloading the data in each tab. So say I was watching a video in one when I switch to the other one it stops the video and when I go back it restarts it. Is there any way to stop it from reloading the tabs once they are loaded? I tried setting cache to true but it didnt seem to fix it. Any help is appreciated.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

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

发布评论

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

评论(2

总以为 2024-08-13 11:09:52

查看选项卡上的缓存选项: http://jqueryui.com/demos/tabs/#选项缓存

将其设置为 true 并且不会重新加载选项卡。

Check out the cache option on the tabs: http://jqueryui.com/demos/tabs/#option-cache.

Set it to true and it won't reload the tab.

戒ㄋ 2024-08-13 11:09:52

问题在于,或标签中的内容每当被隐藏时都会被浏览器重新加载。

您还可以看到,要更改嵌入对象,您需要为其重写 HTML,仅更改 src 属性并不能解决问题。

The problem is that content in or tags is reloaded by the browser whenever it is hidden.

You can also see that to get embedded objects to change you need to rewrite the HTML for it, simply changing the src attribute will not cut it.

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