Tooltip in fullcalendar not working

戏子无情 提交于 2019-12-12 06:16:24

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!