I'm trying to make html inside popover. But it doesn't works .

<a class="tasks-menu" data-toggle="popover" data-placement="bottom">Tasks</a>

<div id="popover_content_wrapper" style="display:none">HIDDEN CONTENT</div>

$(function(){

    $('[data-toggle=popover].tasks-menu').popover({ 
        html : true, 
        content: function() {
          return $('#popover_content_wrapper').html();
        }
    });

});
有帮助吗?

解决方案

The Bootstrap popover works fine with your code. If you want to put the entire html of popover_content_wrapper inside the popover, you should use .clone() instead of .html()

http://www.bootply.com/121357

.html() will just get the inside of popover_content_wrapper, which results in the text "HIDDEN CONTENT" to show in the popover

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top