www.webdeveloper.com
Results 1 to 3 of 3

Thread: jquery 2 Tabs issue

  1. #1
    Join Date
    Aug 2008
    Location
    Phoenix, AZ
    Posts
    84

    jquery 2 Tabs issue

    I have 2 different jQuery UI tab containers that I want to link to each other. Basically when the first tab on the first container is clicked, then the first tab on the second container is then selected and shows it's content. And if the second tab on the first container is clicked, then the second tab on the second container is made active.

    I can get the index of the clicked tab no problem, my issue is making it to where I can change the selected tab. Anyone have a good idea on how to go about it?
    Keep your nose to the grindstone, it sharpens your boogers.

  2. #2
    Join Date
    Aug 2008
    Location
    Phoenix, AZ
    Posts
    84
    Nevermind, got it resolved.
    Code:
    <script>
    $('#tab2').tabs();
    $('#tab1').tabs({
    	show: function() {
    		var selected = $(this).tabs( "option", "selected" );
    		$('#tab2').tabs( "option", "selected", selected );
    	}
    });
    </script>
    Keep your nose to the grindstone, it sharpens your boogers.

  3. #3
    Join Date
    Apr 2011
    Location
    Missouri
    Posts
    83
    Untested...

    Code:
    <script>
    $('#tab2').tabs({
            select: function() {
    
                    $('#tabs1').tabs( "select" , $(this).tabs( "option", "selected" ));
            },
    	show: function() {
    
    		var selected = $(this).tabs( "option", "selected" );
    		$('#tab1').tabs( "option", "selected", selected );
    	});
    
    $('#tab1').tabs({
            select: function() {
    
                    $('#tabs2').tabs( "select" , $(this).tabs( "option", "selected" ));
            },
    	show: function() {
    
    		var selected = $(this).tabs( "option", "selected" );
    		$('#tab2').tabs( "option", "selected", selected );
    	}
    });
    </script>

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles