jquery 选项卡重新加载
我正在尝试找出如何按照我想要的方式加载选项卡。基本上,当有人访问我的页面时,我希望它创建 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
查看选项卡上的缓存选项: 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.
问题在于,或标签中的内容每当被隐藏时都会被浏览器重新加载。
您还可以看到,要更改嵌入对象,您需要为其重写 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.