简体   繁体   中英

jquery ui tabs support for the browers back button

I have a jquery driven web application and a particular page on the site, I use the jquery ui tab control - http://jqueryui.com/demos/tabs/

This enables me to have a page where content separated by tabs.

This works well without issue.

I now need to add support for the browsers back button - so if I have 4 tabs - A, B, C, D and currently on tab C. When I press the back button of the browser, I would like to return to tab B and press it again, return to tab A. How can I integrate this in to the jquery ui tabs?

Secondly, I when the browsers back button is pressed, along with moving to the previous tab, I would like for the page NOT to refresh if possible. So that the movement for the user seemless and close to instant. How possible is this?

If I understand the question correctly, you can use the jQuery BBQ plugin by Ben - http://benalman.com/projects/jquery-bbq-plugin/

Similar to your requirement is the demo that Ben provides at http://benalman.com/code/projects/jquery-bbq/examples/fragment-basic/

Hope it helps.

You're confusing the browser back button's role. It is meant go back in browsing history, not to cycle thru your tabs. You need to add a prev/next link on you page to cycle thru your tabs.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM