click event in jQuery and right mouse clicking

前端 未结 4 1719
没有蜡笔的小新
没有蜡笔的小新 2021-02-09 09:25

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

4条回答
  •  无人及你
    2021-02-09 09:59

    in my case, i do disable the right click context menu first:

    $("#calendar").on("contextmenu",function (event) {
                  event.preventDefault();
                  });
    

    then on the render event i add this:

      eventRender: function(event, element) {
    ...
     var event2=event;
         element.on('contextmenu', function (event) { showMenu(event2.start,event2,event.pageX,event.pageY); });
    ...
    }
    

    where ShowMenu is my own menu Div with options, in the same cursor position...

提交回复
热议问题