This should do it..
rightClickTest:function(event){
if (event.button == 2){
event.preventDefault();
alert("Right Click is not possible Here !")
}
}
Frage
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.
Lösung
This should do it..
rightClickTest:function(event){
if (event.button == 2){
event.preventDefault();
alert("Right Click is not possible Here !")
}
}