Created
April 15, 2014 16:59
-
-
Save blvrd/10747600 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$(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