Last active
August 29, 2015 14:03
-
-
Save crongro/a318a3fe9c201658e53c to your computer and use it in GitHub Desktop.
[setTimeout] mouseover 건너뛰기.
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
<div id="wrap"></div> |
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 ele = document.getElementById("wrap"); | |
var bMouseOver = false; | |
ele.addEventListener("mouseover" , function(e) { | |
bMouseOver = true; | |
setTimeout(function() { | |
if(bMouseOver) { | |
console.log("mouseover") | |
} | |
}, 200); | |
}); | |
ele.addEventListener("mouseout" , function(e) { | |
bMouseOver = false; | |
console.log("mouseout"); | |
}); | |
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
#wrap { | |
outline : 1px solid red; | |
width : 100px; | |
height : 100px; | |
position : absolute; | |
top : 100px; | |
left : 300px; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment