如何在jquery中启用右键单击?
问题描述:
所以我得到了这个jquery min的javascript文件,它阻止了我页面中的右键单击功能.我不知道在哪里重新启用右键单击功能,我搜索了整个代码,什么也没有: 我搜索过的第一行是这样的:
So I got this jquery min javascript file and it is blocking the right-click feature in my page. I've got no idea where to re-enable the right click feature, I've searched the whole code and nothing: The first line I've searched at was this:
var Z=/^(?:input|select|textarea)$/i,et=/^key/,tt=/^(?:mouse|contextmenu)|click/,nt=/^(?:focusinfocus|focusoutblur)$/,rt=/^([^.]*)(?:\.(.+)|)$/;
答
问题不可能是jQuery,因为jQuery不会执行任何此类操作.
The problem could not be jQuery, because jQuery does not do any such thing.
您应该在某处放置另一个代码块,这可能会阻止contextmenu事件的默认操作,如下所示,将其删除即可,您应该没事
You should have another block of code somewhere which might be preventing the default action of the contextmenu event like below, remove that and you should be fine
$(document).on('contextmenu',function (e) {
e.preventDefault();
})