Jquery 如何阻止bootstrap popover表单消失

Jquery 如何阻止bootstrap popover表单消失,jquery,twitter-bootstrap,Jquery,Twitter Bootstrap,接下来,我在引导导航栏中使用的popover中放置了一个表单。当我将鼠标悬停在链接上时,弹出窗口可以正常工作,但是当我试图移动鼠标到达弹出窗口窗体时,弹出窗口消失了!我怎样才能解决这个问题 导航栏项目: <li <? if($active == "change_password") echo "class=\"active\""?>> <?php echo '<a href="#" id="popover">the popover link</a&

接下来,我在引导导航栏中使用的popover中放置了一个表单。当我将鼠标悬停在链接上时,弹出窗口可以正常工作,但是当我试图移动鼠标到达弹出窗口窗体时,弹出窗口消失了!我怎样才能解决这个问题

导航栏项目:

<li <? if($active == "change_password") echo "class=\"active\""?>>
<?php echo '<a href="#" id="popover">the popover link</a>' ?>
</li>
<li class="divider-vertical"></li>

你可能已经解决了这个问题,或者有了一个解决方案,但是我想分享我的解决方案,因为我需要同样的东西,而且模式对于设计来说不是最优的。这适用于Bootstrap 2.x和3.x,并将保持click事件的切换行为

$('li:contains("the popover link")').popover({
    html : true,
    title: function() {
        return $("#popover-head").html();
    },
    content: function() {
        return $("#popover-content").html();
    }
}).mouseenter(function () {
    if (!$(this).parent().find('.popover').length) {
        $(this).popover('show');
    }
});

您是否考虑过使用模态替代?这似乎更适合你正在尝试做的事情你有一些事件悬停,鼠标悬停,鼠标进入。。。关于元素?这是个好主意-我将检查模态。谢谢-比尔
$('li:contains("the popover link")').popover({
    html : true,
    title: function() {
        return $("#popover-head").html();
    },
    content: function() {
        return $("#popover-content").html();
    }
}).mouseenter(function () {
    if (!$(this).parent().find('.popover').length) {
        $(this).popover('show');
    }
});