Detect click on background event

我的未来我决定 提交于 2019-11-28 04:05:53

问题


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)?


回答1:


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');
        }
    },
    ...
});


来源:https://stackoverflow.com/questions/27359369/detect-click-on-background-event

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!