How to insert close button in popover for bootstrap

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

JS:

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


        
25条回答
  •  难免孤独
    2020-11-29 21:38

    For me this is the simplest solution to add a close button in a popover.

    HTML:

        
    
        
    

    Javascript:

        document.addEventListener("click",function(e){
            // Close the popover 
            if (e.target.id == "close_popover"){
                    $("[data-toggle=popover]").popover('hide');
                }
        });
    

提交回复
热议问题