Created
February 5, 2016 17:48
-
-
Save nikartx/05acba0e5b793746bd86 to your computer and use it in GitHub Desktop.
JS timeout for hover over an element
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
//Set timeout if hover over an element | |
$(document).ready(function() { | |
$('#slider').hover( | |
// if hover over an element | |
function(){ | |
setTimeout(function() { | |
$('i.arrows').css({"opacity":"1"}); | |
}, | |
300); | |
}, | |
// if don't bring element | |
function(){ | |
setTimeout(function() { | |
$('i.arrows').css({"opacity":"0"}); | |
}, | |
500); | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment