【发布时间】:2019-04-30 11:13:48
【问题描述】:
我在我的代码中使用 popover,如下所示:
var popOverSettings = {
placement: 'top',
container: 'body',
html: true,
selector: '[rel="popover"]',
content: function () {
return 'hello world';
}
}
$('body').popover(popOverSettings).popover('show');
<div rel='popover'>Show popover</div>
我希望看到弹出框打开,但它不起作用。
【问题讨论】:
-
什么是 HTML 标记?
-
@Zim 我用 HTML 标记更新了
-
javascript 在标记中的什么位置执行?在你的 div 之前还是之后?您是否在 jquery
$( document ).ready(function() { console.log( "everything loaded" ); });中尝试过?有任何控制台错误吗? -
我都做了。没有错误。我发现应该使用 id 或 class 而不是“body”。