使用完整日历在内容窗口上方保持弹出窗口打开

Keep popover open while over content window with fullcalendar

本文关键字:窗口 方保持 日历      更新时间:2023-09-26

我正在尝试弄清楚从事件块悬停到弹出框内容窗口后,如何在悬停时保持完整日历弹出窗口打开。

http://jsfiddle.net/rjayako/7zoqgroj/

目前,当您将鼠标悬停

在事件块上时,弹出窗口会显示,但当您将鼠标悬停在其他任何位置时会立即消失。我试图实现的是,当您将鼠标悬停在弹出框本身上时,该框仍然显示,以便用户可以单击弹出框内的链接。

这是我的弹出框的事件渲染到目前为止的样子

  eventRender: function(event, element) {
    element.popover({
      title: "My Title",
      placement: 'bottom',
      html: true,
      content: event.msg,
      trigger: "hover"
    });
  },

任何帮助将不胜感激。

问候。

这是你的答案。禁用动画并使弹出框手动触发。JSfiddle

animation:false 
trigger: "manual"

以下是完整的事件渲染:

eventRender: function (event, element) {
                    element.popover({
                    title: "My Title",
                    placement: 'bottom',
                    html: true,
                    animation:false,
                    content: event.msg,
                    trigger: "manual"
                        }).on("mouseenter", function () {
                            var _this = this;
                            $(this).popover("show");
                            $(".popover").on("mouseleave", function () {
                                $(_this).popover('hide');
                            });
                        }).on("mouseleave", function () {
                            var _this = this;
                            setTimeout(function () {
                                if (!$(".popover:hover").length) {
                                    $(_this).popover("hide");
                                }
                            }, 300);
                        });
                      }