微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

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 收集整理的教程希望能对你有所帮助,如果觉得编程之家不错,可分享给好友!感谢支持

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。

相关推荐