Skip to content

Instantly share code, notes, and snippets.

View theneubeck's full-sized avatar

Jens Carlén theneubeck

View GitHub Profile
@theneubeck
theneubeck / gist:300479
Created February 10, 2010 16:13
jQuery toggle 2
$("#the-link").toggle(
function(){ ... },
function(){ ... },
function(){ ... },
function(){ ... }
);
@theneubeck
theneubeck / jQueryToggle.js
Created February 10, 2010 16:12
jQuery Toggle
$("#the-link").toggle(function(){
$(this).text("Show");
// hide a list of related items to
$(this).parents(".my-list").find("li").hide();
}, function(){
$(this).text("Hide");
$(this).parents(".my-list").find("li").show();
});