开发者

jquery hover triggering on element under absolute element

开发者 https://www.devze.com 2023-02-16 07:32 出处:网络
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

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
}
0

精彩评论

暂无评论...
验证码 换一张
取 消