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如何实现鼠标悬停显示提示信息
基础教程推荐
猜你喜欢
- 比特币新时代:BRC-20的机遇与风险 2023-12-26
- vue项目中使用 vant 组件无法修改css样式 2023-10-08
- Vue.js基础知识 2023-10-08
- es6中的解构赋值、扩展运算符和rest参数使用详解 2023-12-14
- JavaScript获取css行间样式,内连样式和外链样式的简单方法 2024-01-17
- 用js实现的仿sohu博客更换页面风格(简单版) 2024-01-16
- 利用原生JavaScript获取元素样式只是获取而已 2024-01-17
- ASP.NET登出系统并清除Cookie 2024-03-08
- bootstrap搜索下拉框插件的使用方法 2022-10-30
- 微信小程序开发实用技巧之数据传递和存储 2023-12-28
