Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Detect click on background event

Tags:

fullcalendar

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 detect this (that the user clicked on a background event)?

like image 890
Leo Avatar asked Dec 08 '14 13:12

Leo


1 Answers

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');
        }
    },
    ...
});
like image 172
regdos Avatar answered Jan 04 '23 15:01

regdos