문제

In my Application,in particular div,I want to show custom right click menu with options instead of default browser menu.

I tried with following code.

events: {
   "contextmenu #navContainer":"rightClickTest"
},
rightClickTest:function(event){
 if (event.button == 2){
   alert("Right Click is not possible Here !")
  }
}

we am using backbone.js for my Application.Event is working fine but the problem is after completion of event logic,default right click menu appearing as usually.

Note:

I want to disable default right click menu at particular div(navContainer) of my App.

How can I fix this.

도움이 되었습니까?

해결책

This should do it..

rightClickTest:function(event){
  if (event.button == 2){
   event.preventDefault();
   alert("Right Click is not possible Here !")
  }
}
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top