Skip to content


Click event in jQuery and right mouse clicking

 

Working example for Fullcalendar v3.4.0, basically it is the alternate of eventRightClick event which was working with previous versions.

var events_array = [{
    title: 'Test1',
    start: new Date(2013, 11, 20)
}, {
    title: 'Test2',
    start: new Date(2013, 11, 21)
}];

$('#mycalendar:not(".fc-event")').on('contextmenu', function (e) {
    e.preventDefault()
})

$('#mycalendar').fullCalendar({
    events: events_array,
    header: {
        left: 'prevYear,prev,next,nextYear today',
        center: 'title',
        right: 'month,agendaWeek,agendaDay'
    },
    eventRender: function (event, element) {
        element.bind('mousedown', function (e) {
            if (e.which == 3) {
                alert('Right mouse button pressed');
            }
        });
    }
});

Posted in Javascript, jquery. Tagged with , , .

0 Responses

Stay in touch with the conversation, subscribe to the RSS feed for comments on this post.

You must be logged in to post a comment.