0

I am using jQuery UI Tabs where I have 3 tabs (T1,T2 and T3) displayed and have the following setup:

   $(function(){
      $tabs = $("#tabs_start_reg");
      $tabs.tabs();
      $tabs.show();
   });

I have the following queries relating to jQuery UI tabs.

Using jQuery:

  1. How can I determine which tab the user has currently clicked on?

  2. How can I calculate the total amount of tabs I am using, in this case 3?

  3. Within the current tab that I am on, I need to branch to another page within my website that falls outside of my jQuery UI tabs and perform some tasks there and then return back.

Now, how can I first store the tab that I am currently on, branch off to another page in the same website and then be able to return back to the tab that I was originally on?

Is this possible?

halfer
  • 19,824
  • 17
  • 99
  • 186
tonyf
  • 34,479
  • 49
  • 157
  • 246

1 Answers1

2

1) jQuery UI Tabs Get Currently Selected Tab Index

2) count the number of existing tabs in jquery?

3) http://forum.jquery.com/topic/jquery-ui-tabs-remember-currently-selected-tab-after-refresh

The magic of Google :-)

Community
  • 1
  • 1
binarious
  • 4,568
  • 26
  • 35
  • 2
    Would have double up voted you (if possible) if they were 'let me google that for you' links :D – Richard Dalton Jun 08 '11 at 08:00
  • Thanks @Martin but I still require assistance with my point 3 above. – tonyf Jun 08 '11 at 08:15
  • You just need to add the cookie option to your tabs method: `$('#tabID').tabs({ cookie: { expires: 7, name: "selectedTabAdminSection" });`. After this, jQuery restores your view. If you want to reset the view, delete the Cookie. – binarious Jun 08 '11 at 08:21