Show one popover and hide other popovers

前端 未结 13 1828
死守一世寂寞
死守一世寂寞 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:15

    When an icon is clicked and has open the corresponding popover then it has a value that begins with "popover*" called aria-describedby.

    So you find this icons and trigger click on them but not on the icon which is clicked now.

    $('.icon-info').click(function(){
        $(".icon-info[aria-describedby*='popover']").not(this).trigger('click');
    });
    

提交回复
热议问题