简体   繁体   English

Fullcalendar V5 在移动 cursor 时显示时间工具提示

[英]Fullcalendar V5 show time tooltip while moving the cursor

While moving the cursor on the calendar I want to show the time.在日历上移动 cursor 时,我想显示时间。 I tried to solve the problem with the viewRender but the 5th version of the full calendar doesn't support it anymore.我试图用 viewRender 解决问题,但完整日历的第 5 版不再支持它。

this what i tried to do:这是我试图做的:

 viewRender: function(view, element){
      $('#calendar').find('.fc-slats').find('[class="fc-widget-content"]').hover(
        function() {
          var tr = $(this).parent();
          var time = tr.find('td.fc-axis.fc-time.fc-widget-content').find("span").text();
          $(this).append('<td class="temp_cell" style="border: 0px; width:5px;">'+time+'</td>');
        },          
        function() {                        
          $(this).children('.temp_cell').remove();
        }
      );
    }

Use eventMouseEnter instead.请改用eventMouseEnter You can use tippyJS for this:您可以为此使用tippyJS:

import tippy from "tippy.js";
...

eventMouseEnter: function (info: any) {
          let tooltip = tippy(info.el, {
            content: time,
            placement: "top",
            interactive: true,
            arrow: true,
            theme: "material",
            appendTo: document.body,
            allowHTML: true,
            duration: [1, 1],
            animation: "scale-extreme",
          }});

https://atomiks.github.io/tippyjs/ https://atomiks.github.io/tippyjs/

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

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