2014-11-02 107 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();