How can I hold Twitter Bootstrap Popover open until my mouse moves into it?

前端 未结 16 1388
野性不改
野性不改 2020-12-04 05:55

I have a link that uses the Twitter Bootstrap Popover version 1.3.0 to show some information. This information includes a link, but every-time I move my mouse from the link

16条回答
  •  时光取名叫无心
    2020-12-04 06:47

    This issue on the bootstrap github repo deals with this problem. fat pointed out the experimental "in top/bottom/left/right" placement. It works, pretty well, but you have to make sure the popover trigger is not positioned statically with css. Otherwise the popover won't appear where you want it to.

    HTML:

    Hover me to show a popover.

    CSS:

    /*CSS */
    .myClass{ position: relative;}
    

    JS:

    $(function(){
      $('.myClass').popover({placement: 'in top'});
    });  
    

提交回复
热议问题