jQuery UI 选项卡后退按钮历史记录 [英] jQuery UI Tabs back button history
问题描述
有没有人能够让 jQuery UI Tabs 3(最新版本)使用后退按钮?
Has anyone been able to get jQuery UI Tabs 3(Latest version) working with the back button?
我的意思是,如果用户点击后退按钮,他们应该转到页面上之前访问过的选项卡,而不是其他页面.
I mean if the user hits the back button they should go to the previously visited tab on the page, not a different page.
历史插件听起来可以工作,但我似乎无法让它工作ajax 加载的标签页.
The history plug in sounds like it can work, but i cant seem to make it work with ajax loaded tabs.
如果有人设法完成这项工作,将不胜感激,谢谢!
If anyone has managed to make this work, it would be deeply appreciated, thanks!
推荐答案
我也遇到了这个问题.在这里使用 jquery 地址插件真的很容易 http://www.asual.com/jquery/address/
I just ran into this as well. Its really easy with the jquery address plugin here http://www.asual.com/jquery/address/
标签的演示似乎有点过于复杂.我刚刚这样做了:
The demo for tabs seemed a bit over complicated. I just did this:
$('document').ready(function() {
// For forward and back
$.address.change(function(event){
$("#tabs").tabs( "select" , window.location.hash )
})
// when the tab is selected update the url with the hash
$("#tabs").bind("tabsselect", function(event, ui) {
window.location.hash = ui.tab.hash;
})
});
这篇关于jQuery UI 选项卡后退按钮历史记录的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!