PHP
- 11 ответов
- 0 вопросов
2
Вклад в тег
$.event.special.dblrightclick = {
setup : function(data, namespaces) {
var e = $(this);
e.bind("contextmenu", $.event.special.dblrightclick.handler);
e.data("x", null);
e.data("y", null);
e.data("time", null);
e.data("limit", data || 400);
},
teardown : function(namespaces) {
$(this).unbind("contextmenu", $.event.special.dblrightclick.handler);
},
handler : function (event) {
event.preventDefault();
var e = $(this);
if (e.data("x") == event.screenX && e.data("y") == event.screenY
&& (event.timeStamp - e.data("time")) < e.data("limit")) {
e.data("x", null);
e.data("y", null);
e.data("time", null);
event.type = "dblrightclick";
$.event.dispatch.apply(this, arguments);
} else {
e.data("x", event.screenX);
e.data("y", event.screenY);
e.data("time", event.timeStamp);
}
}
};
$("#widget").on("dblrightclick", ".button", function() {
alert("dblrightclick fired");
});
$("#widget").on("dblrightclick", ".button", 200, function() {
alert("dblrightclick fired");
});
# chcon -R -t httpd_sys_content_rw_t /project_root