gpt4 book ai didi

javascript - jquery fullcalendar 删除弹出窗口

转载 作者:行者123 更新时间:2023-11-30 12:32:31 25 4
gpt4 key购买 nike

我发现样本几乎和我的一样,我需要它,如果我点击屏幕上的任何地方,弹出窗口就会隐藏。是否可以?如果是,如何?

$.fn.popover.defaults.container = 'body';

$('#mycalendar').fullCalendar(
{
defaultView: "agendaWeek",
slotMinutes:60,
allDaySlot:false,
header: {
left: 'prev,next today',
center: 'title',
right: 'agendaWeek,agendaDay'
},
eventRender: function (event, element) {
element.popover({
title: "My Title",
placement: event.start.getHours()>12?'top':'bottom',
html:true,
content: event.msg
});
},
editable: false,
events: [
{
title : 'Click me 3',
msg: 'I am clipped to the right which is annoying',
start : '2011-05-07 12:00:00',
end : '2011-05-07 13:00:00',
editable: false,
allDay : false
}
]
});
$('#mycalendar').fullCalendar( 'gotoDate', 2011,04,7 );

可以找到 jsfiddle HERE .

任何帮助我将不胜感激

最佳答案

尝试在 eventrender 函数中进行以下更改:

eventRender: function (event, element) {
element.popover({
title: "My Title",
placement: event.start.getHours()>12?'top':'bottom',
html:true,
content: event.msg,
trigger: 'focus' // trigger popover on element focus
});
element.attr('tabindex', -1); // make the element (div) focusable
},

我还更新了 jsfiddle here .

关于javascript - jquery fullcalendar 删除弹出窗口,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27186319/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com