如何为JQuery popover添加换行符
如何在弹出窗口内容中添加换行符? 换行标记和换行符都不起作用。 这就是我正在尝试的:
$(".foo").hover(function () { $(this).popover({ title: "Bar", content: "Line 1
Line 2 \n Line 3" }).popover('show'); }, function () { $(this).popover('hide'); });
初始化弹出框时,需要传递选项html: true
。 然后
和其他html标签应该工作:
$(".foo").hover(function () { $(this).popover({ title: "Bar", content: "Line 1
Line 2
Line 3", html: true }).popover('show'); }, function () { $(this).popover('hide'); });
https://groups.google.com/forum/?fromgroups=#!topic/twitter-bootstrap/bhtpERLYCo4