使用jQuery捕获Shift和Click事件 [英] Capture a Shift and Click event with jQuery

查看:140
本文介绍了使用jQuery捕获Shift和Click事件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我似乎无法同时捕获两个事件.我正在尝试捕获Shift和Click(鼠标单击)事件.

I don't seem to be able to capture two events at the same time. I am trying to capture the Shift and Click (mouse click) event.

我毫无疑问地分别捕获每个动作,而不是同时捕获两个动作.

I have no problem capturing each action separately but not the two together.

有人针对这个特定问题进行过研究吗?

Has anybody done some research on that particular problem?

推荐答案

是:

$(document).click(function(e) {
    if (e.shiftKey) {
        alert("shift+click")
    } 
});

这篇关于使用jQuery捕获Shift和Click事件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆