【发布时间】:2013-05-01 21:24:59
【问题描述】:
我找到了以下示例,它显示了我需要从弹出窗口中获得的行为: How to dismiss a Twitter Bootstrap popover by clicking outside?
但是,有谁知道如何在 fullcalendar 中实现类似的行为? (即使用全日历事件)谢谢。
【问题讨论】:
标签: twitter-bootstrap fullcalendar popover
我找到了以下示例,它显示了我需要从弹出窗口中获得的行为: How to dismiss a Twitter Bootstrap popover by clicking outside?
但是,有谁知道如何在 fullcalendar 中实现类似的行为? (即使用全日历事件)谢谢。
【问题讨论】:
标签: twitter-bootstrap fullcalendar popover
其实我觉得我找到了解决问题的办法:
$('#calendar').fullCalendar({
eventRender: function (event, element) {
if (!event.url)
{
element.popover({
placement: 'bottom',
html:true,
title: 'text',
content: 'text
});
$('body').on('click', function (e) {
if (!element.is(e.target) && element.has(e.target).length === 0 && $('.popover').has(e.target).length === 0)
element.popover('hide');
});
}
}
});
这似乎在 fullcalendar 中运行良好。
谢谢。
【讨论】:
更简单:您可以将隐藏事件附加到实际元素本身:
element.on('click', function() {
element.popover('hide');
};
【讨论】: