Detect click on background event

后端 未结 1 932
终归单人心
终归单人心 2020-12-19 09:47

I have a Fullcalendar calendar and I add on it some background events. Those background events represent slots that cannot be clicked or dragged into. Is there a way to dete

相关标签:
1条回答
  • 2020-12-19 10:32

    Background event is rendered as a DIV with the class name fc-bgevent.

    My code for detecting the click background event is:

    element.fullCalendar({ 
        ...
        dayClick: function(date, jsEvent, view) {
            if (jsEvent.target.classList.contains('fc-bgevent')) {
                alert('Click Background Event Area');
            }
        },
        ...
    });
    
    0 讨论(0)
提交回复
热议问题