BootStrap使用popover插件实现鼠标经过显示并保持显示框

网络编程 发布日期:2024/10/4 浏览次数:1

正在浏览:BootStrap使用popover插件实现鼠标经过显示并保持显示框

在商城里,导航栏的购物车展示经常需要鼠标经过时,显示已经放入购物车的商品,bootstrap是没有直接用的插件的,这个时候就可以使用popover这个插件改造后实现,具体如下:

实现效果图:

BootStrap使用popover插件实现鼠标经过显示并保持显示框

html实现:

<a href="#" rel="drevil">
<span class="glyphicon glyphicon-shopping-cart"> </span> 购物车
</a>

javascript实现:

$(function(){
$("[rel=drevil]").popover({
trigger:'manual',
placement : 'bottom', //placement of the popover. also can use top, bottom, left or right
title : '<div style="text-align:center; color:red; text-decoration:underline; font-size:14px;"> Muah ha ha</div>', //this is the top title bar of the popover. add some basic css
html: 'true', //needed to show html of course
content : '<div id="popOverBox"><img src="/UploadFiles/2021-04-02/mr-evil.jpg">

以上所述是小编给大家介绍的BootStrap使用popover插件实现鼠标经过显示并保持显示框,希望对大家有所帮助,如果大家有任何疑问请给我留言,小编会及时回复大家的。在此也非常感谢大家对网站的支持!