qtip在fullcalendar中出现多次

问题描述 投票:0回答:1

我在fullcalendar中实现了qtip2以下是我为渲染工具提示编写的代码

eventRender: function (event, element) {
        element.find('.fc-title').append("<br/>" + event.shiftname);
        element.qtip({
            content: {
                text: function (api) {
                    var content = event.description;
                    if (content != '')
                        return content;
                }
            },
            position: { viewport: true },
            style: { classes: 'qtip-custom' },
        });
    }

鼠标悬停在事件上时会出现。但是当我调整事件大小时,qtip会多次出现。 enter image description here

jquery fullcalendar qtip2
1个回答
1
投票

我在qtip中添加了show:{solo:true}选项

            element.qtip({
            content: {
                text: function (api) {
                    var content = event.description;
                    if (content != '')
                        return content;
                }
            },
            position: { viewport: true },
            style: { classes: 'qtip-custom' },
            show: { solo: true }
        });

这解决了我的问题。

© www.soinside.com 2019 - 2024. All rights reserved.