Twitter bootstrap tooltips do not work for events in fullcalendar

。_饼干妹妹 提交于 2019-12-07 15:55:25

问题


I want to show bootstrap tooltips over events in fullcalendar of Adam Shaw. I tried this code:

eventMouseover: function (event, jsEvent) {
                $(this).tooltip();
                $(this).css('rel', 'tooltip');
                $(this).tooltip({
                    selector: '[rel=tooltip]'
                });                
            },

But it does not work. What's wrong here?


回答1:


You can shorten your answer a bit like this:

eventAfterRender: function (event, element) {
        $(element).tooltip({title:event.title, container: "body"});
}



回答2:


I got it working:

eventRender: function (event, element) {
            var tooltip = event.Description;
            $(element).attr("data-original-title", tooltip)
            $(element).tooltip({ container: "body"})
           }



回答3:


My solution is:

 $('#calendar').fullCalendar({
      ...
      events: [
       {"title":"foo",
        "description":"bar<br>baz",
        "start":"2015-08-28 17:45:00",
        "url":"foo"},
       { ...
       }
       ],
      eventMouseover: function(event, element) {
        $(this).tooltip({title:event.description, html: true, container: "body"});
        $(this).tooltip('show');
      }
    });



回答4:


In fullCalendar 4, I just replyed here: Tooltip in fullcalendar not working

use eventRender function:

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


来源:https://stackoverflow.com/questions/18633687/twitter-bootstrap-tooltips-do-not-work-for-events-in-fullcalendar

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