Return to Snippet

Revision: 40424
at February 2, 2011 00:40 by mckewans


Initial Code
/* EXAMPLE

<ul id="gateType">
<div class="title">Title OF<a id="gth" href="#" title="hide">HIDE</a></div>
<li>blah</li>
<li>blah</li>
<li>blah</li>
</ul>

*/

		(function( $ ){
  			$.fn.showhide = function() {
  		
  			var $this = $(this);
  			var $parent = $this.closest('ul');
  			
			$this.toggle(function() {
				$this.text("SHOW");
				$parent.find('li').slideUp();
				return false;
			}, function() {
				$this.text("HIDE");
				$parent.find('li').slideDown();
				return false;
			});

  		};
		})( jQuery );



/*

USE:

$("#gth").showhide();

*/

Initial URL


Initial Description
toggle function for showing/hiding LI elements that slide up/down into the UL title box

Initial Title
toggle function

Initial Tags
function

Initial Language
jQuery