Skip to content

Instantly share code, notes, and snippets.

@blvrd
Created April 15, 2014 16:59
Show Gist options
  • Save blvrd/10747600 to your computer and use it in GitHub Desktop.
Save blvrd/10747600 to your computer and use it in GitHub Desktop.
$(function(){
$(document).foundation();
// Hides every element except the first one
$("fieldset.person").slice(1).addClass("hidden")
// Used the "on click" to handle event bubbling
$(".row").on("click", ".add-person", function() {
// Finds the last fieldset that is visible and makes the next hidden one visible
$("fieldset.person").not(".hidden").last().next("fieldset.person").removeClass("hidden")
})
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment