我正在为我的事件加载工具提示;但是,工具提示似乎在“eventLimit”弹出框内不起作用。
我曾尝试重新初始化单击事件的工具提示,但单击事件发生在之前,而我需要在.
我可以连接到之后或其他一些事件吗?
// tried this but it doesn't work...
eventLimitClick: function () {
$('[data-toggle="tooltip"]').tooltip({ container: 'body', html: true }); // re-init tooltips
return "popover";
},
Codepen 示例: https ://codepen.io/anon/pen/xWLKeK?editors=0110
完整代码(供参考):
$(function() {
$('#calendar').fullCalendar({
defaultView: 'month',
defaultDate: '2018-03-07',
header: {
left: 'prev,next',
center: 'title',
right: 'month,agendaWeek,agendaDay'
},
eventRender: function (event, element) {
element
.attr('title', event.title)
.attr('data-placement', 'bottom')
.attr('data-toggle', 'tooltip');
},
eventLimit: 2, // allow "more" link when too many events
eventAfterAllRender: function () {
$('[data-toggle="tooltip"]').tooltip({ container: 'body', html: true });
},
// tried this but it doesn't work...
eventLimitClick: function () {
$('[data-toggle="tooltip"]').tooltip({ container: 'body', html: true }); // re-init tooltips
return "popover";
},
events: [
{
title: 'All Day Event',
start: '2018-03-01'
},
{
title: 'Long Event',
start: '2018-03-07',
end: '2018-03-10'
},
{
id: 999,
title: 'Repeating Event',
start: '2018-03-09T16:00:00'
},
{
id: 999,
title: 'Repeating Event',
start: '2018-03-16T16:00:00'
},
{
title: 'Conference',
start: '2018-03-11',
end: '2018-03-13'
},
{
title: 'Meeting',
start: '2018-03-12T10:30:00',
end: '2018-03-12T12:30:00'
},
{
title: 'Lunch',
start: '2018-03-12T12:00:00'
},
{
title: 'Meeting',
start: '2018-03-12T14:30:00'
},
{
title: 'Birthday Party',
start: '2018-03-13T07:00:00'
},
{
title: 'Click for Google',
url: 'http://google.com/',
start: '2018-03-28'
}
]
});
});