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


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM