gpt4 book ai didi

javascript - Bootstrap Popover Dismissable 不起作用

转载 作者:行者123 更新时间:2023-11-30 17:12:35 27 4
gpt4 key购买 nike

<a href="#" class="btn btn-warning" id="no_mls_entry" tabindex="2" data-toggle="popover" data-trigger="focus" data-placement="left auto" title="Early Bird Gets The Worm" data-content="Sometimes it takes some time for the MLS&reg; RETS pool to update your new listing. Loading it manually early, then sharing on social media will give you better exposure on Google.">Enter Without MLS #</a>

以上是我的 popover HTML 语法,根据他们的说明设置为 data-trigger="focus"以使其在点击时消失。

然后在文档准备好后,我运行这个:

$('#no_mls_entry').popover('show');

弹出窗口显示正常,但点击它后,它不会消失。

最佳答案

这似乎是焦点管理方式的问题。

您可以尝试以下方法来强制聚焦:

$('#no_mls_entry').popover('show').focus();

这是 bootply 中的代码示例:

http://www.bootply.com/J1iTFk9M1Y

或者,如果您不想在页面加载时显示弹出框,您可以使用以下代码加载弹出框,它会在按下按钮时触发:

$('#no_mls_entry').popover();

关于javascript - Bootstrap Popover Dismissable 不起作用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26694669/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com