I am using jQuery tabs like the following:
http://jqueryui.com/tabs/
Where I can display a line of tabs along a top and the HTML is split into these sections and is seen by activating these tabs.
However I am not entirely satisfied with this feel.
As I have various Hrefs around the system that redirect to various places, I want to know if anyone knows if there is a way of being able to direct to a link to a page that displays these tabs, while opening the relevant tab from the URL or a different approach?
For example The simple way when you give a div an ID and can href to that ID and the page scrolls down to that point. With this you can specify in the URL which tab on the page you wish to go to. Although once combining it with jQuery, this is not possible.
Creating the Tabs
All of our calls happen within document.ready() function.
First we’ll create the tabs using the normal jQuery UI technique. In this case, we’ve wrapped the tabs ul and related divs in a div with a class of “tab-set”.
Getting New Visitors to the Correct Tab
Next, we want to see if we need to load a specific tab. We’ll check to see if the page we’re on has a “tab-set” div, and check the URL to see if there’s a hash on the end of it. If yes to both, then we use the scrollTo plugin to jump us down to the “tab-set” div — which keeps the tabs visible — while relying jQuery UI’s default behavior to show the correct tab content.
Creating Bookmarkable URLs for the Tabs
Once a user is on the page, we use the localScroll plugin to update the URL in the address bar while keeping the page from reloading.
What that says is “Scroll to the div ‘tab-set’ instead of the target of the link itself, do it with no animation, and add the hash to the URL”.
That’s it! All requirements met.
came from How to Open A specific Tab from Link in jQuery