Created
May 4, 2009 04:18
-
-
Save ajtack/106296 to your computer and use it in GitHub Desktop.
Using JQuery, takes any link in the login form of a particular class, automatically converts the text to an ID-able string (e.g. "Phone Number" -> "session_phone_number"), and then shows that div and hides all the others.
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
$(document).ready(function() { | |
$('#LoginForm a.login_method_switch').click(function() { | |
var blockToShow = '#session_' + this.text.toLowerCase().replace(' ', '_'); | |
$('#LoginForm ' + blockToShow).show("slow"); | |
$('#LoginForm .session_login_method:not(' + blockToShow + ')').hide("slow"); | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment