bootstrap 問號鼠標懸浮,顯示提示信息

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

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章