How to insert close button in popover for bootstrap

前端 未结 25 2945
忘了有多久
忘了有多久 2020-11-29 20:53

JS:

$(function(){
  $(\"#example\").popover({
    placement: \'bottom\',
    html: \'true\',
    title : \'         


        
25条回答
  •  情歌与酒
    2020-11-29 21:35

    Sticky on hover, HTML:

    ...
    

    Javascript:

    $('[data-toggle=popover]').hover(function(e) {
      if( !$(".popover").is(':visible') ) {
          var el = this;
          $(el).popover('show');
          $(".popover > h3").append('')
                            .find('.close').on('click', function(e) {
                                e.preventDefault();
                                $(el).popover('hide');
                            }
          );
      }
    });
    

提交回复
热议问题