Skip to content

Instantly share code, notes, and snippets.

@drewwells
Created February 20, 2012 16:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save drewwells/1870099 to your computer and use it in GitHub Desktop.
Save drewwells/1870099 to your computer and use it in GitHub Desktop.
Hover Blur menu effect
/*
* 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