Skip to content

Instantly share code, notes, and snippets.

@crongro
Last active August 29, 2015 14:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save crongro/a318a3fe9c201658e53c to your computer and use it in GitHub Desktop.
Save crongro/a318a3fe9c201658e53c to your computer and use it in GitHub Desktop.
[setTimeout] mouseover 건너뛰기.
<div id="wrap"></div>
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");
});
#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