bootstrap popover 鼠标移至上面显示
html 元素中增加属性 data-toggle及data-content
<label data-toggle="popover" data-content="111">测试</label>
js中增加
$(function () {
$("[data-toggle='popover']").popover({
trigger:'manual',
placement : 'top',//弹出位置
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);
});
});
参考链接:https://www.jb51.net/article/87218.htm
浙公网安备 33010602011771号