问题
everyone! I'm trying to show tooltip over events in fullcalendar. But it's not working and show in console this message
Uncaught SyntaxError: Unexpected token (
What can be a problem? This is my js-function code:
$('#calendar').fullCalendar(function() {
eventAfterRender: function(event, element) {
$(element).tooltip({
title: event.title,
container: "body"
});
}
});
回答1:
You are passing function. You should pass your options and callbacks. Read Docs
$('#calendar').fullCalendar({ //Removed function() from here
eventAfterRender: function(event, element) {
$(element).tooltip({
title: event.title,
container: "body"
});
}
});
回答2:
In FullCalendar 4, use eventRender function:
eventRender: function (info) {
$(info.el).tooltip({ title: info.event.title });
}
来源:https://stackoverflow.com/questions/30119156/tooltip-in-fullcalendar-not-working