开发者

jQuery : mousemove on 'body', and avoid 'menu' element

开发者 https://www.devze.com 2023-02-25 02:47 出处:网络
is there a possibility to use the mousemove on the \'body\', and avoid at the same time an element of the DOM, like the div \'menu\' ?

is there a possibility to use the mousemove on the 'body', and avoid at the same time an element of the DOM, like the div 'menu' ? The idea is to show the 'prev' or 'next' arrow in the background, but hide it -> if 开发者_开发知识库we enter in the menu element.

I tried this :

$('body').not('#menu').bind('mousemove', function(e){

but it didn't work out...


Try this:

$('body').bind('mousemove', function(e){
 // Your Code to handle Mouse Move Globally.
});

$('#menu').bind('mousemove', function(e){
 // Your Code to handle Mouse Move on the #Menu.
 //##################
  e.stopPropagation();
});
0

精彩评论

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