1.Bootstrap彈出框示例
<button type="button" class="btn btn-lg btn-danger" data-toggle="popover" title="Popover title" data-content="And here's some amazing content. It's very engaging. Right?">點(diǎn)我彈出/隱藏彈出框</button>

2.改進(jìn)
有時(shí)提示框內(nèi)容較多,僅僅使用data-content,title,在html文檔里寫(xiě)出來(lái)比較亂,我們可以借助提供的popover()方法,實(shí)現(xiàn)對(duì)彈出框內(nèi)容、樣式的修改。
$("#btn-danger").popover({ html: true, //實(shí)現(xiàn)對(duì)html可寫(xiě) title: keywords_title(), //標(biāo)題函數(shù) content: function() { return keywords_content(); //內(nèi)容函數(shù) }});//標(biāo)題函數(shù) function keywords_title() { return '結(jié)果說(shuō)明:';}//內(nèi)容函數(shù),同時(shí)對(duì)樣式進(jìn)行修改function keywords_content() { var data = $('<div style="width:700px;color: #787671" ><p><span>提及結(jié)果列關(guān)鍵詞不區(qū)分英文大小寫(xiě)</span></p></div>');}//以下是彈出框樣式,可以根據(jù)需要自定義修改.popover { position: absolute; top: 0; left: 0; z-index: 1060; display: none; max-width: 276px; padding: 1px; font-size: 14px; font-weight: 400; line-height: 1.42857143; text-align: left; white-space: normal; background-color: #fff; -webkit-background-clip: padding-box; background-clip: padding-box; border: 1px solid #ccc; border: 1px solid rgba(0,0,0,.2); border-radius: 6px; -webkit-box-shadow: 0 5px 10px rgba(0,0,0,.2); box-shadow: 0 5px 10px rgba(0,0,0,.2);}以上所述是小編給大家介紹的Bootstrap彈出框之自定義懸停框標(biāo)題、內(nèi)容和樣式示例代碼,希望對(duì)大家有所幫助,如果大家有任何疑問(wèn)請(qǐng)給我留言,小編會(huì)及時(shí)回復(fù)大家的。在此也非常感謝大家對(duì)武林網(wǎng)網(wǎng)站的支持!
新聞熱點(diǎn)
疑難解答
圖片精選
網(wǎng)友關(guān)注