Created
September 16, 2015 19:20
-
-
Save taniarascia/88ca8051fe064ee193f0 to your computer and use it in GitHub Desktop.
Show after hover for period of time
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
var fadeTimeout; | |
console.log(fadeTimeout); | |
$("#menu").hover(function () { | |
fadeTimeout = setTimeout(showFade, 2000); | |
}, | |
hideFade); | |
function showFade() { | |
var fade = $("<div class='secret-menu'><a href='secret-menu.pdf' style='color:black' >Shhhh! Secret Menu!</a></div>"); | |
fade.appendTo($("#menu")); | |
} | |
function hideFade() { | |
clearTimeout(fadeTimeout); | |
$(".secret-menu").fadeOut().remove(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment