手机
当前位置:查字典教程网 >编程开发 >Javascript教程 >BootStrap使用popover插件实现鼠标经过显示并保持显示框
BootStrap使用popover插件实现鼠标经过显示并保持显示框
摘要:在商城里,导航栏的购物车展示经常需要鼠标经过时,显示已经放入购物车的商品,bootstrap是没有直接用的插件的,这个时候就可以使用popo...

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

实现效果图:

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

html实现:

<a href="#" rel="drevil"> <span> </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> 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="http://www.hd-report.com/wp-content/uploads/2008/08/mr-evil.jpg" width="251" height="201" /></div>', //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插件实现鼠标经过显示并保持显示框,希望对大家有所帮助,如果大家有任何疑问请给我们留言,小编会及时回复大家的。在此也非常感谢大家对查字典教程网的支持!

【BootStrap使用popover插件实现鼠标经过显示并保持显示框】相关文章:

jQuery实现鼠标经过图片变亮其他变暗效果

javascript实现淡蓝色的鼠标拖动选择框实例

在JavaScript应用中使用RequireJS来实现延迟加载

基于jQuery插件实现环形图标菜单旋转切换特效

JS实现窗口加载时模拟鼠标移动的方法

jQuery使用zTree插件实现树形菜单和异步加载

JavaScript实现的MD5算法完整实例

JavaScript实现鼠标点击后层展开效果的方法

js实现鼠标移到链接文字弹出一个提示层的方法

JS和css实现检测移动设备方向的变化并判断横竖屏幕

精品推荐
分类导航