Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2

Thread: jquery tabs

  1. #1
    Regular Coder
    Join Date
    May 2008
    Posts
    446
    Thanks
    23
    Thanked 5 Times in 5 Posts

    jquery tabs

    I have a taken some code from an internet source which works just fine, that creates a tab setup. The only thing is I need it to go one more level of content down. So basically the first tab displays another section of tabs which will each open up their own grouped content below w/out hiding the second group of tags.

    My jquery so far is as follows. The cells section at the bottom is the one created based off the second one which holds the grouped content that was selected by the second set of tabs.

    Code:
    $(document).ready(function() {
    // setting the tabs in the sidebar hide and show, setting the current tab
    	$('div.tabbed div').hide();
    	$('div.celled div').hide();
    	$('div.t1').show();
    	$('div.tabbed ul.tabs li.t1 a').addClass('tab-current');
    
    // SIDEBAR TABS
    $('div.tabbed ul li a').click(function(){
    	var thisClass = this.className.slice(0,2);
    	$('div.tabbed div').hide();
    	$('div.' + thisClass).show();
    	$('div.tabbed ul.tabs li a').removeClass('tab-current');
    	$(this).addClass('tab-current');
    	});
    });
    /*
    // SIDEBAR CELLS
    $('div.celled table a').click(function(){
    	var thisClass = this.className.slice(0,2);
    	$('div.celled div').hide();
    	$('div.' + thisClass).show();
    	$('div.celled table.cell a').removeClass('cells-current');
    	$(this).addClass('cells-current');
    	});
    });
    currently it all works except the 2cd set of tabs hides when I try to open 3rd grouped content.

    here is my website:

    http://royalvillicus.com/code_builder/header.php


    Thanks a lot for your help

  • #2
    Senior Coder tomws's Avatar
    Join Date
    Nov 2007
    Location
    Arkansas
    Posts
    2,644
    Thanks
    29
    Thanked 330 Times in 326 Posts
    The second set of tabs are in a div. You have this in the inner link click event:
    Code:
    $('div.tabbed div').hide();
    If you don't want it hidden, you probably shouldn't hide it.

    EDIT: No. After thinking about that for a minute, that's incomplete (bad) advice. Looks like you may be working on it right now since it's a bit different than before. I noticed that the first link in the second list has an onclick.
    Last edited by tomws; 01-28-2010 at 07:25 PM.
    Are you a Help Vampire?


  •  

    Posting Permissions

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