3

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"
        });
    }
});
ADyson
  • 57,178
  • 14
  • 51
  • 63

2 Answers2

7

In FullCalendar 4, use eventRender function:

eventRender: function (info) {
  $(info.el).tooltip({ title: info.event.title });     
}
Antonio Santise
  • 302
  • 3
  • 5
6

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"
        });
    }
});
Satpal
  • 132,252
  • 13
  • 159
  • 168