Created
February 20, 2012 16:56
-
-
Save drewwells/1870099 to your computer and use it in GitHub Desktop.
Hover Blur menu effect
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
/* | |
* Two parts, anchors that will drop down some sort of menu ".nav.user a" | |
* ".nav.login" is shown and stays shown when hovered | |
*/ | |
var loginModule = $(".nav.login"), | |
fade; | |
$(".nav.user a").add( loginModule ).hover(function( ){ | |
if( /signup/.test( this.className ) ){ | |
loginModule.addClass( "signup" ).removeClass( "hidden" ); | |
} else if( /login/.test( this.className ) ){ | |
loginModule.removeClass( "signup" ).removeClass( "hidden" ); | |
}// else if( /login/.test( this.className ) ){ | |
// Just reject nothing else to do | |
//} | |
if( fade ) fade.reject(); | |
}, function(){ | |
var scopeFade = fade = $.Deferred().done(function(){ | |
loginModule.addClass( "hidden" ); | |
}); | |
setTimeout(function(){ | |
if( scopeFade ) scopeFade.resolve( ); | |
}, 1000); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment