Bootstrap中的弹出框插件popover.js中的参数title、content不能使用html代码

Bootstrap中的弹出框插件popover.js中的参数title、content都不能使用html代码,有什么办法解决?
LEATH
浏览 439回答 2
2回答

Helenr

可以自定义啊自定义HTML自定义HTML$(".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("mouseentered");$(".popover").on("mouseleave",function(){$(_this).popover('hide');});}).on("mouseleave",function(){var_this=this;setTimeout(function(){if(!$(".popover:hover").length){$(_this).popover("hide");}},100);});functiongetPopoverTitle(target){return$("#"+target+"_content>h2.popover-title").html();};functiongetPopoverContent(target){return$("#"+target+"_content>div.popover-content").html();};
打开App,查看更多内容
随时随地看视频慕课网APP

相关分类

JavaScript