开发者

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

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜