2014-11-02 105 views
1
<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> 

以上是我弹出的HTML语法,根据它们的指示将它设置为data-trigger =“focus”,使它在点击时消失。Bootstrap Popover Dismissable is not working

,然后在文件准备好了,我这条命令:

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

的酥料饼好吗显示出来,但点击它,它不会消失。

回答

2

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

你可以尝试以下迫使焦点:

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

下面是代码的bootply一个例子:

http://www.bootply.com/J1iTFk9M1Y

或者,如果你愿意不显示弹出式页面加载时,您可以使用以下代码加载弹出窗口,并在按下按钮时触发它:

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