How to make bootstrap tooltip remain visible till the link is clicked

前端 未结 2 1628
轮回少年
轮回少年 2020-12-24 12:18

I have a link which I am going to use as notification when a user has some new notification I am going to notify the user by showing a tooltip(twitter bootstrap tooltip). Wh

2条回答
  •  旧巷少年郎
    2020-12-24 12:52

    Here is the solution http://jsfiddle.net/testtracker/QsYPv/8/

    Added the option "trigger"

    $('p a').tooltip({placement: 'bottom',trigger: 'manual'}).tooltip('show');
    

    then, with this line

    $('p a').on('click',function(){$(this).tooltip('destroy');});
    

    destroy tooltip on click.

提交回复
热议问题