Bootstrap's tooltip doesn't disappear after button click & mouseleave

前端 未结 22 939
感情败类
感情败类 2020-12-07 16:24

I have a problem with bootstrap\'s tooltip : When I click on a button, tooltip stays even if is the cursor is outside of the button. I have looked into the manual - Bootstra

22条回答
  •  借酒劲吻你
    2020-12-07 16:45

    Hi i have little solution for this issue. When other solutions doesn't work just try this one:

    $('body').tooltip({
            selector: '[data-toggle="tooltip"], [title]:not([data-toggle="popover"])',
            trigger: 'hover',
            container: 'body'
        }).on('click mousedown mouseup', '[data-toggle="tooltip"], [title]:not([data-toggle="popover"])', function () {
            $('[data-toggle="tooltip"], [title]:not([data-toggle="popover"])').tooltip('destroy');
        });
    

    This is solution for drag and drop too. So i hope this help someone :)

提交回复
热议问题