Created
March 24, 2016 04:39
-
-
Save huy-tran/4e12353c2ed27f59f215 to your computer and use it in GitHub Desktop.
jQuery Toggle Selection
This file contains hidden or 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
var $formChoice = $('.gh-form-choice'); | |
$('#typesOfStudy').on('change', function () { | |
var value = $(this).val(); | |
if (value !== '') { | |
var formToShown = '.gh-form-' + value; | |
$formChoice.not(formToShown).slideUp(400, function () { | |
$(formToShown).slideDown(); | |
}); | |
} else { | |
$formChoice.slideUp(); | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment