Versions Compared

Key

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

...

Code Block
$(document).ready(function()\{

Wiki Markup
 block (which is the main block of a jQuery program, we might include the following code to effect an expansion when the \[+\] clicker is clicked.

Code Block
	//community/collection hierarchy
	//expansion with the plus sign (or horizontal arrow)
	$("p.ListPlus").click(function(){
		$(this).hide();
		$(this).next("p.ListMinus").show();
		//slideDown animation doesn't work in IE6:
		if(navigator.userAgent.match("MSIE 6")) 
		{
		    $(this).parent().find("p.ListPlus").hide();
		    $(this).parent().find("p.ListMinus").show();
		    $(this).parent().find("p.ListMinus + span.bold ~ ul").show();
		}
		else
		{
		    $(this).parent().children("ul").slideDown("fast");
		}
	});

...