Created
September 14, 2011 15:01
-
-
Save markrickert/1216804 to your computer and use it in GitHub Desktop.
There Can Be Only One...
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 there_can_be_only_one_highlander(the_one) { | |
var state_speed = 500, | |
immortals = ['#welcome-box', '#guest-box', '#login-box', '#register-box'], | |
to_kill = [], | |
key = null; | |
for (key in immortals) { | |
if (immortals[key] !== the_one) { | |
if (typeof immortals[key] === 'string') { | |
to_kill.push(immortals[key]); | |
} | |
} | |
} | |
jQuery(to_kill.join(',')).fadeOut(state_speed); | |
setTimeout(function() {jQuery(the_one).slideDown(state_speed);}, state_speed); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment