bootstrap如何实现鼠标悬停显示提示信息,下面编程教程网小编给大家详细介绍一下具体代码!
html代码:
<button type="button" rel="drevil" data-content="具体时间:'+time+'"
data-container="body" data-toggle="popover" data-placement="bottom"></button>
js代码:
$(function () { $("[data-toggle='popover']").popover(); });
$("[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>',
html: 'true', //needed to show html of course
//content : '<div id="popOverBox"></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")
}
}, 300);
});
以上是编程学习网小编为您介绍的“bootstrap如何实现鼠标悬停显示提示信息”的全面内容,想了解更多关于 前端知识 内容,请继续关注编程基础学习网。
织梦狗教程
本文标题为:bootstrap如何实现鼠标悬停显示提示信息


基础教程推荐
猜你喜欢
- flex布局出现宽度动态扩展问题,flex设置固定宽度3个方法 2025-01-16
- 基于JavaScript实现 获取鼠标点击位置坐标的方法 2023-12-01
- jQuery插件expander实现图片翻转特效 2023-12-28
- input file样式修改以及图片预览删除功能详细概括(推荐) 2024-01-07
- 基于html css实现带搜索图标的搜索框功能 2023-12-11
- 子Div使用Float后撑开父Div的几种方法 2024-01-24
- 网站加载中loading..样式三代码介绍 2025-01-16
- 使用JavaScript修改浏览器URL地址栏的实现代码 2024-01-05
- How to convert HTML Report to picture format in Email? 2023-10-27
- CSS制造:鼠标移上去显示大图 2022-11-06