最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - Tooltip in fullcalendar not working - Stack Overflow

programmeradmin3浏览0评论

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"
        });
    }
});

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"
        });
    }
});
Share Improve this question edited Oct 23, 2019 at 16:13 ADyson 62k16 gold badges75 silver badges89 bronze badges asked May 8, 2015 at 8:24 Андрей БарановАндрей Баранов 4234 gold badges6 silver badges15 bronze badges 0
Add a ment  | 

2 Answers 2

Reset to default 7

In FullCalendar 4, use eventRender function:

eventRender: function (info) {
  $(info.el).tooltip({ title: info.event.title });     
}

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"
        });
    }
});
发布评论

评论列表(0)

  1. 暂无评论