Go Back   CodingForums.com > :: Client side development > JavaScript programming > JavaScript frameworks

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 01-28-2010, 05:36 PM   PM User | #1
surreal5335
Regular Coder

 
Join Date: May 2008
Posts: 446
Thanks: 23
Thanked 5 Times in 5 Posts
surreal5335 is an unknown quantity at this point
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
surreal5335 is offline   Reply With Quote
Old 01-28-2010, 07:04 PM   PM User | #2
tomws
Senior Coder

 
tomws's Avatar
 
Join Date: Nov 2007
Location: Arkansas
Posts: 2,644
Thanks: 29
Thanked 330 Times in 326 Posts
tomws will become famous soon enoughtomws will become famous soon enough
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.
__________________
Are you a Help Vampire?

Last edited by tomws; 01-28-2010 at 07:25 PM..
tomws is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 05:59 PM.


Advertisement
Log in to turn off these ads.