Created
August 6, 2011 01:59
-
-
Save spacecowb0y/1128909 to your computer and use it in GitHub Desktop.
Find provider
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
// medio cabeza, es la primera version, lo escribí de corrido eh, sin ningún error. | |
$(function(){ | |
function find_provider(str) { | |
str = str.split("@"); | |
str = str[1]; | |
str = str.split("."); | |
str = str[0]; | |
if ( (str != "gmail") || (str != "yahoo") || (str != "hotmail") ) { | |
$('form small span').removeClass('current'); | |
} | |
switch (str) | |
{ | |
case "gmail": | |
$('form small span').removeClass('current'); | |
$('#'+str).addClass('current'); | |
break; | |
case "yahoo": | |
$('form small span').removeClass('current'); | |
$('#'+str).addClass('current'); | |
break; | |
case "hotmail": | |
$('form small span').removeClass('current'); | |
$('#'+str).addClass('current'); | |
break; | |
} | |
console.log(str); | |
} | |
$('#user_email').keyup(function(e) { | |
find_provider($(this).val()); | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment