Skip to content

Instantly share code, notes, and snippets.

@blairanderson
Created May 1, 2013 05:08
Show Gist options
  • Save blairanderson/5493840 to your computer and use it in GitHub Desktop.
Save blairanderson/5493840 to your computer and use it in GitHub Desktop.
my first jquery GIST. i'm really having fun with jquery this project. i hope to be saving more and more of these in the future found here: http://stackoverflow.com/a/11263756/1536309 proven here: http://jsfiddle.net/6RKHf/ i was hoping to show a list of options on a hover that lasts more than 4 seconds
var timeoutId;
$("#NewsStrip").hover(function() {
if (!timeoutId) {
timeoutId = window.setTimeout(function() {
timeoutId = null; // EDIT: added this line
$("#SeeAllEvents").slideDown('slow');
}, 2000);
}
},
function () {
if (timeoutId) {
window.clearTimeout(timeoutId);
timeoutId = null;
}
else {
$("#SeeAllEvents").slideUp('slow');
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment