0

我想知道是否有一种方法可以在用户悬停在弹出框上时保持显示(我的意思是,不仅是触发元素,还有弹出框本身)?

就我而言,我的内部有一个链接popover content,但用户无法单击它,因为popover离开hover触发器 elelement( hover trigger) 时隐藏自身...

4

1 回答 1

0

我还没有看到任何带有hover触发器的解决方案,这里是我使用这个问题manual的触发器的解决方案

$('.selector').popover({
        html: true,
        trigger: 'manual',
        container: $(this).attr('id'),
        placement: 'top',
        content: function () {
            $return = '<div class="hover-hovercard"></div>';
        }
    }).on("mouseenter", function () {
        var _this = this;
        $(this).popover("show");
        $(this).siblings(".popover").on("mouseleave", function () {
            $(_this).popover('hide');
        });
    }).on("mouseleave", function () {
        var _this = this;
        setTimeout(function () {
            if (!$(".popover:hover").length) {
                $(_this).popover("hide")
            }
        }, 100);
    });
于 2013-09-01T09:30:39.013 回答