可以自定义啊 <div id="pop_content" class="popover fade right"> <div class="arrow"></div> <h2 class="popover-title">自定义HTML</h2> <div class="popover-content">自定义HTML</div> </div> <script> $(".pop").each(function() { var $pElem = $(this); $pElem.popover({ html: true, trigger: "manual", title: getPopoverTitle($pElem.attr("id")), content: getPopoverContent($pElem.attr("id")), container: 'body', animation: false }); }).on("mouseenter", function() { var _this = this; $(this).popover("show"); console.log("mouse entered"); $(".popover").on("mouseleave", function() { $(_this).popover('hide'); }); }).on("mouseleave", function() { var _this = this; setTimeout(function() { if (!$(".popover:hover").length) { $(_this).popover("hide"); } }, 100); }); function getPopoverTitle(target) { return $("#" + target + "_content > h2.popover-title").html(); }; function getPopoverContent(target) { return $("#" + target + "_content > div.popover-content").html(); }; </script>
<button type="button" class="btn btn-lg btn-danger" data-toggle="popover" title="Popover title" data-html="true" data-content="<div>百度</div>">点我弹出/隐藏弹出框</button> 加上 data-html="true"即可,或者js初始化时加上 html:"true"
可以自定义啊