我一直在试图找出如何通过点击fc-day元素来触发fc-more元素中的“单击”操作。
我认为最好的方法是在日历的选项中使用dayClick,同时对其进行初始化。问题是如何找到该元素,并单击它。我不知道为它生成的'id‘,但类是“fc-更多”。
如有任何建议,请见谅!
发布于 2016-05-31 04:53:28
有可能,你需要黑进fullcalendar.js
查找以setElement: function(el) {
开头的函数。在FullCalendar v2.5.0中,它位于注释下面的第3175行
// Sets the container element that the grid should render inside of.
// Does other DOM-related initializations.
您需要向此函数添加其他条件,如下所示
el.on('mousedown', function(ev) {
if (
!$(ev.target).is('.fc-event-container *, .fc-more') && // not an an event element, or "more.." link
!$(ev.target).closest('.fc-popover').length // not on a popover (like the "more.." events one)
) {
_this.dayMousedown(ev);
}else{
alert('you clicked more');
}
});
您也可以在“否则”中添加这一行,以检查它是否更简单。
if ($(ev.target).is('.fc-event-container *, .fc-more') )
https://stackoverflow.com/questions/37531453
复制相似问题