bootstrap如何实现鼠标悬停显示提示信息
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如何实现鼠标悬停显示提示信息”的全面内容,想了解更多关于 前端知识 内容,请继续关注编程基础学习网。