Show one popover and hide other popovers

前端 未结 13 1827
死守一世寂寞
死守一世寂寞 2020-12-24 04:45

i have several buttons and i need a popover for each.
i want it like this:
when my user click on one of them, i want others to be hidden. so only one popover is show

相关标签:
13条回答
  • 2020-12-24 05:24

    With the help of "losmescaleros" answer, this works perfectly for me :

    $('body').popover({
      selector: '[data-toggle="popover"]',
      trigger: "click"
    }).on("show.bs.popover", function(e){
      // hide all other popovers
      $("[data-toggle='popover']").not(e.target).popover("destroy");                  
    });
    

    Without any double click issues.

    0 讨论(0)
提交回复
热议问题