开发者

cross-browser right click plugin with jquery?

开发者 https://www.devze.com 2022-12-17 09:51 出处:网络
i\'ve got a context menu plugin that will show a context menu when right clicking an element. but that doesnt work on ajax embedded elements. so i have to use ajax live that trigger the context menu f

i've got a context menu plugin that will show a context menu when right clicking an element. but that doesnt work on ajax embedded elements. so i have to use ajax live that trigger the context menu function when it senses a r开发者_如何学运维ight click.

is there a plugin for jquery detecting right clicks?


Try this block of code:

$("body").mousedown(function(e) {
  var code = ( e.keyCode ? e.keyCode : e.which );

  if( code === 3 ) {
    // do your right-click code here
  }
});


A plugin isn't necessary. To detect right clicks, check out this previous question: jquery right click event?

0

精彩评论

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