View Single Post
Old 08-15-2012, 05:16 PM  
sarettah
see you later, I'm gone
 
Industry Role:
Join Date: Oct 2002
Posts: 14,070
Quote:
Originally Posted by Lace View Post
Hmm...going to try this http://jsfiddle.net/sYwER/5/

Just might work for what I need.

Edit: Nope, unordered and ordered lists are not hidden.
Taking what you had and then a little from what you found:

Script:

Code:
$(document).ready(function(){
	$(".head").click(function(){
		$(this).find(".expanderContent").slideToggle();
		if ($(this).find(".expanderSign").text() == "+"){
			$(this).find(".expanderSign").html("−")
		}
		else {
			$(this).find(".expanderSign").text("+")
		}
	});
});
Changed up the html a touch to wrap each of your sections in a div:

Code:
<div class=head>
<h4 class="expanderHead">
	HEADER 1<span class="expanderSign">+</span>
</h4>
<div class="expanderContent" style="display:none">
TEXT HERE
</div>
</div>

<div class=head>
<h4 class="expanderHead">
	HEADER 2 <span class="expanderSign">+</span>
</h4>
<div class="expanderContent" style="display:none">
TEXT HERE
</div>
</div>

 <div class=head>
<h4 class="expanderHead">
	HEADER 3 <span class="expanderSign">+</span>
</h4>
<div class="expanderContent" style="display:none">
TEXT HERE
</div>
</div>
http://madspiders.com/divtest.htm
__________________
All cookies cleared!

Last edited by sarettah; 08-15-2012 at 05:18 PM..
sarettah is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote