Jquery Tabs - Hiding all divs instead of just parent

LZ1
LZ1 used Ask the Experts™
on
Hey Experts!!

I have a basic tab code that I found online and I need to customize it a little bit.  
The tabs I have are pretty extensive with a lot of content inside them, including divs.  To see what I'm talking about go to the live url below and click on the Testimonials tab. There should be a YouTube video, description and a slider on the bottom. It's hiding all of the child divs in there and I need them to be shown when I click on the tab.

Ultimate Goal: If I have nested divs, I need to show all of them when the tab is clicked.  It's beyond my jquery knowledge.

Live URL: http://gator716.hostgator.com/~donjr/ 
Jquery is attached
jQuery.noConflict();
jQuery(document).ready(function(){
	jQuery('#homevideo div').hide();
	jQuery('#homevideo div').hide();
	jQuery('#homevideo div:first').show();
	jQuery('#homevideo ul li:first').addClass('selected');
	
	jQuery('#homevideo ul.ui-tabs li a').click(function(){
	jQuery('#homevideo ul li').removeClass('selected');
	jQuery(this).parent().addClass('selected');
	var currentTab = jQuery(this).attr('href');
		jQuery('#homevideo div').hide();
		jQuery(currentTab).children().show();
	return false;
	});
});

Open in new window

Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Consultant & Challenge Subduer
Top Expert 2009
Commented:
jQuery offers many selectors for use.

The code can be further shortened by making "$" be an alias for "jQuery" within the function.
jQuery.noConflict();
jQuery(document).ready(function(){
	var $=jQuery;
	$('#homevideo>div:not(:first)').hide();
	$('#homevideo>.ui-tabs li:first').addClass('selected');
	
	$('#homevideo .ui-tabs a').click(function(){
		$('#homevideo .ui-tabs li').removeClass('selected');
		$(this).parent().addClass('selected');
		var currentTab = $(this).attr('href');
		$('#homevideo>div').hide();
		$(currentTab).show();
		return false;
	});
});

Open in new window

P.S. Do you really need both Prototype (with Scriptaculous) and jQuery?
LZ1
Top Expert 2011

Author

Commented:
Thanks Kravimir. Works like a charm.  I didn't code or develop this project, it was dropped in my lap.  I'd much rather stay with Jquery than any other library, however it's a slow process.  My first task was re-writing the tabs on the home page.  Now that that's done, on to the next task.

Thanks again!

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial