Return to Snippet

Revision: 45521
at May 3, 2011 06:29 by diogoweb


Initial Code
<p><a href="#how-to" class="toggle">How to write a good article?</a></p>
<div id="how-to">
	How to tips go here.
</div>
$('a.toggle').toggle(function() {
	var id = $(this).attr("href");
	$(this).addClass("active");
	$(id).slideDown();
}, function() {
	var id = $(this).attr("href");
	$(this).removeClass("active");
	$(id).slideUp();
});

Initial URL
http://eisabainyo.net/weblog/2010/09/01/10-useful-jquery-snippets/

Initial Description


Initial Title
Show/hide more content on click

Initial Tags


Initial Language
jQuery