首页 > 其他 > 详细

bootstrap popover 鼠标移至上面显示

时间:2019-09-30 11:40:08      阅读:97      评论:0      收藏:0      [点我收藏+]

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

bootstrap popover 鼠标移至上面显示

原文:https://www.cnblogs.com/webttt/p/11611694.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!