Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Wiki Markup
This code assigns an anonymous function to occur when the <p> is clicked.  This function hides the \[+\] clicker that was clicked, shows the \[-\] clicker, and does a slide-down animation to reveal the contents of the community.  There is also a branch to catch IE6 browsers (for which the animation doesn't work nicely).
The following similar code will effect a collapse when the \[-\] clicker is clicked.

Code Block
	//contraction with the minus sign (or vertical arrow)
	$("p.ListMinus").click(function(){
		$(this).hide();
		$(this).prev("p.ListPlus").show();
		//slideUp animation doesn't work in IE6:
		if(navigator.userAgent.match("MSIE 6")) 
		{
		    $(this).parent().find("p.ListPlus").show();
		    $(this).parent().find("p.ListMinus").hide();
		    $(this).parent().find("p.ListMinus + span.bold ~ ul").hide();
		}
		else
		{
		    $(this).parent().children("ul").slideUp("fast");
		}
	});