简体   繁体   English

当事件的渲染选项等于背景时,Fullcalendar 工具提示无法正常工作

[英]Fullcalendar tooltip not working correctly when event's rendering option is equals to background

I am trying to use Fullcalendar 4.3.1 to show holidays in background while other events are shown on same date.我正在尝试使用 Fullcalendar 4.3.1 在背景中显示假期,而在同一日期显示其他事件。 My aim is when users mouse over days I show the holiday name through tooltip, while the background is in another color and other events can be added.我的目标是当用户将鼠标悬停在几天时,我通过工具提示显示假日名称,而背景为另一种颜色,并且可以添加其他事件。

Antonio Santise's answer worked in order to show the tooltips, however when I set event's rendering option as 'background' only the last one event's tooltip is shown. Antonio Santise 的回答是为了显示工具提示,但是当我将事件的渲染选项设置为“背景”时,只显示最后一个事件的工具提示。 Could someone help me to avoid this behavior and show all event's tooltips?有人可以帮助我避免这种行为并显示所有事件的工具提示吗?

My code:我的代码:

  • Getting data with Laravel's model使用 Laravel 的 model 获取数据
public function index() {
    $eventos = EventoCalendario::selectRaw('id, \'true\' as allDay, title, data as start, data as end, color, is_facultativo, \'background\' as rendering')
                        ->orderBy('data')
                        ->get();

    return view('eventoscalendario.index', compact('eventos'));
}
  • Fullcalendar's options Fullcalendar 的选项
events: {!! $eventos !!},
eventRender: function(info) {
   $(info.el).tooltip({
          title: info.event.title,
          html: true
   });
}

Thanks in advance!提前致谢!

Fullcalendar team offered a "skeleton" that solved the described problem. Fullcalendar 团队提供了解决上述问题的“骨架”。 However, they are still working to fix this in a next release.但是,他们仍在努力在下一个版本中解决此问题。

Click here to check the issue #5110 in Fullcalendar's repo单击此处查看 Fullcalendar 的 repo 中的问题 #5110

THE SOLUTION:解决方案:

Just insert the CSS code below in your page.只需在页面下方插入 CSS 代码即可。

.fc-bgevent-skeleton {
  pointer-events: none;
}
.fc-bgevent-skeleton .fc-bgevent {
  pointer-events: auto;
}
.fc-content-skeleton {
  pointer-events: none;
}
.fc-content-skeleton .fc-event {
  pointer-events: auto;
}

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM