如何在JQuery中检查是否单击了鼠标中键 [英] How do I check mouse middle button clicked or not in JQuery

查看:105
本文介绍了如何在JQuery中检查是否单击了鼠标中键的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一张桌子,因为链接数量很多,所以如果链接被点击,那么它的颜色会发生变化。

我尝试下面的代码

I have one table in that there are number of links so if link get clicked then its color changes.
I tryied below code

$("#mytable a").live( function (e) {
       
            $(this).addClass("change");
            $(this).css('color', 'green');
        
    });



现在问题是点击它后打开链接但链接颜色没有改变,我想要这两个功能左侧和中间按钮。


Now the issue is After click it opens the link but link color doen't change and i want this functionality on both left and middle button.

推荐答案

(# mytable a)。live( function (e){
("#mytable a").live( function (e) {


(this) addClass(change) ;
(this).addClass("change");


(this).css('color','green');

});
(this).css('color', 'green'); });



现在问题是点击它后链接但链接颜色没有改变,我想在左侧和中间按钮上的这个功能。


Now the issue is After click it opens the link but link color doen't change and i want this functionality on both left and middle button.


这篇关于如何在JQuery中检查是否单击了鼠标中键的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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