jquery hover triggering on element under absolute element
Is it possible to have the jQuery hover event (or mouseenter or mouseover events) trigger on an element that is positioned under a fixed or absolutely positioned div that covers the triggering element? Hopefully this makes sense. Thanks in advance
EDIT This is the solution I came up with. Are there any more efficient ways of doing what this code accomplishes? http://jsfiddle.net/GQugb/5/ Only problem with it is if the user goes really fast over the boxes, eventually they will all get开发者_StackOverflow中文版 stuck yellow. Any suggestions?
before the edit i would have said "try css: .outer{ pointer-events:none;}",
after the edit, i'd suggest a lock variable for each hover function:
var lock = false;
function hover(){
if(lock) return;
lock=true;
//do stuff
setTimeout(function(){lock=false;},1000); //1 second delay
}
精彩评论