click event in jQuery and right mouse clicking

前端 未结 2 1852
半阙折子戏
半阙折子戏 2021-02-09 09:41

Does click trigger when right mouse button was clicked? I want to implement a right click kind of menu with full calendar, but it only has dayClick event, which I think is trigg

2条回答
  •  栀梦
    栀梦 (楼主)
    2021-02-09 09:55

    Your answer is No, click doesn't trigger when right mouse button is clicked, but you can try mousedown event, check this out:

    jQuery(document.body).on("mousedown", function(event){
        if(event.button==2){
            //do what you want
        }
    });
    

提交回复
热议问题