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

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

实现效果图:

html实现:

rush:js;"> 购物车

javascript实现:

rush:js;"> $(function(){ $("[rel=drevil]").popover({ trigger:'manual',placement : 'bottom',//placement of the popover. also can use top,bottom,left or right title : '
decoration:underline; font-size:14px;"> Muah ha ha
',//this is the top title bar of the popover. add some basic css html: 'true',//needed to show html of course content : '
Box">

',//this is the content of the html Box. add the image here or anything you want really. animation: false }).on("mouseenter",function () { var _this = this; $(this).popover("show"); $(this).siblings(".popover").on("mouseleave",function () { $(_this).popover('hide'); }); }).on("mouseleave",function () { var _this = this; setTimeout(function () { if (!$(".popover:hover").length) { $(_this).popover("hide") } },100); }); });

以上所述是小编给大家介绍的BootStrap使用popover插件实现鼠标经过显示并保持显示框。编程之家 jb51.cc 收集整理的教程希望能对你有所帮助,如果觉得编程之家不错,可分享给好友!感谢支持

相关文章

Bootstrip HTML 查询搜索常用格式模版 <form class=&...
如何在按钮上加红色数字 您可以使用Bootstrap的badge组件来在...
要让两个按钮左右排列,你可以使用 Bootstrap 的网格系统将它...
是的,可以将status设置为布尔类型,这样可以在前端使用复选...
前端工程师一般用的是Bootstrap的框架而不是样式,样式一般自...
起步导入:<linkrel="stylesheet"href="b...