中文字幕一区二区人妻电影,亚洲av无码一区二区乱子伦as ,亚洲精品无码永久在线观看,亚洲成aⅴ人片久青草影院按摩,亚洲黑人巨大videos

Bootstrap4 彈出框

彈出框控件類似于提示框,它在鼠標(biāo)點(diǎn)擊到元素后顯示,與提示框不同的是它可以顯示更多的內(nèi)容。


如何創(chuàng)建彈出框

通過向元素添加 data-toggle="popover" 來來創(chuàng)建彈出框。

title 屬性的內(nèi)容為彈出框的標(biāo)題,data-content 屬性顯示了彈出框的文本內(nèi)容:

<a href="#" data-toggle="popover" title="彈出框標(biāo)題" data-content="彈出框內(nèi)容">多次點(diǎn)我</a>

注意: 彈出框要寫在 jQuery 的初始化代碼里: 然后在指定的元素上調(diào)用 popover() 方法。

以下實(shí)例可以在文檔的任何地方使用彈出框:

實(shí)例

$(document).ready(function(){ $('[data-toggle="popover"]').popover(); });

運(yùn)行代碼 ?

指定彈出框的位置

默認(rèn)情況下彈出框顯示在元素右側(cè)。

可以使用 data-placement 屬性來設(shè)定彈出框顯示的方向: top, bottom, left 或 right:

實(shí)例

<a href="#" title="Header" data-toggle="popover" data-placement="top" data-content="Content">點(diǎn)我</a> <a href="#" title="Header" data-toggle="popover" data-placement="bottom" data-content="Content">點(diǎn)我</a> <a href="#" title="Header" data-toggle="popover" data-placement="left" data-content="Content">點(diǎn)我</a> <a href="#" title="Header" data-toggle="popover" data-placement="right" data-content="Content">點(diǎn)我</a>

運(yùn)行代碼 ?

按鈕中使用:

實(shí)例

<button type="button" class="btn btn-secondary" data-container="body" data-toggle="popover" data-placement="top" data-content="Vivamus sagittis lacus vel augue laoreet rutrum faucibus."> Popover on top </button> <button type="button" class="btn btn-secondary" data-container="body" data-toggle="popover" data-placement="right" data-content="Vivamus sagittis lacus vel augue laoreet rutrum faucibus."> Popover on right </button> <button type="button" class="btn btn-secondary" data-container="body" data-toggle="popover" data-placement="bottom" data-content="Vivamus sagittis lacus vel augue laoreet rutrum faucibus."> Popover on bottom </button> <button type="button" class="btn btn-secondary" data-container="body" data-toggle="popover" data-placement="left" data-content="Vivamus sagittis lacus vel augue laoreet rutrum faucibus."> Popover on left </button>

運(yùn)行代碼 ?

關(guān)閉彈出框

默認(rèn)情況下,彈出框在再次點(diǎn)擊指定元素后就會關(guān)閉,你可以使用 data-trigger="focus" 屬性來設(shè)置在鼠標(biāo)點(diǎn)擊元素外部區(qū)域來關(guān)閉彈出框:

實(shí)例

<a href="#" title="取消彈出框" data-toggle="popover" data-trigger="focus" data-content="點(diǎn)擊文檔的其他地方關(guān)閉我">點(diǎn)我</a>

運(yùn)行代碼 ?

提示:如果你想實(shí)現(xiàn)在鼠標(biāo)移動到元素上顯示,移除后消失的效果,可以使用 data-trigger 屬性,并設(shè)置值為 "hover":

實(shí)例

<a href="#" title="Header" data-toggle="popover" data-trigger="hover" data-content="一些內(nèi)容">鼠標(biāo)移動到我這</a>

運(yùn)行代碼 ?