How to insert close button in popover for bootstrap

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

JS:

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


        
25条回答
  •  囚心锁ツ
    2020-11-29 21:27

    Just wanted to update the answer. As per Swashata Ghosh, the following is a simpler way that worked for moi:

    HTML:

    
    

    JS:

    $('.example').popover({
       title: function() {
          return 'Popup title' +
                 '';
       },
       content: 'Popup content',
       trigger: 'hover',
       html: true
    });
    
    $('.popover button.close').click(function() {
       $(this).popover('toggle');
    });
    

提交回复
热议问题