Skip to content

Instantly share code, notes, and snippets.

@taniarascia
Created September 16, 2015 19:20
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save taniarascia/88ca8051fe064ee193f0 to your computer and use it in GitHub Desktop.
Save taniarascia/88ca8051fe064ee193f0 to your computer and use it in GitHub Desktop.
Show after hover for period of time
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