html:
<span
class="glyphicon glyphicon-question-sign" rel="drevil"
data-container="body" data-toggle="popover" data-placement="bottom"
data-content="通過單擊項目將其移出已選列表(同時放回可選列表)"></span>
js:
$(function () { $("[data-toggle='popover']").popover(); });
$("[rel=drevil]").popover({
trigger:'manual',
html: 'true',
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")
}
}, );
});
原文鏈接:https://blog.csdn.net/wen_284334906/article/details/110121559