Can I use dynamic content in a Bootstrap popover?

前端 未结 5 1057
独厮守ぢ
独厮守ぢ 2020-12-29 07:44

I am using a Bootstrap Popover in a \'Repeat Region\' which displays Testimonials. Each testimonials has a \'View Property Details\' button which opens up the popover. In th

5条回答
  •  抹茶落季
    2020-12-29 08:05

    var popover = $("[rel=details]").popover({
        trigger: 'hover',
        placement: 'bottom',
        html: 'true'
    }).on('show.bs.popover', function () {
        //I saw an answer here  with 'show.bs.modal' it is wrong, this is the correct, 
        //also you can use   'shown.bs.popover to take actions AFTER the popover shown in screen.
        $.ajax({
            url: 'data.php',
            success: function (html) {
                popover.attr('data-content', html);
            }
        });
    });
    

提交回复
热议问题