如何为 dataTables 中的元素运行 popover?
Posted
技术标签:
【中文标题】如何为 dataTables 中的元素运行 popover?【英文标题】:How to run popover for elements inside dataTables? 【发布时间】:2017-09-15 05:17:27 【问题描述】:我尝试为我在其上运行数据表的表中的某些元素运行引导弹出窗口。我使用此代码但不起作用。
JS:
$('#dynamic-table1').dataTable(
"aaSorting": [
[3, "desc"]
],
"fnDrawCallback": function (oSettings)
$('[data-toggle="popover"]').popover();
);
html:
<a data-toggle="popover" title="توضیحات کاربر ارشد" data-content="Description" data-trigger="focus">
如何解决?
【问题讨论】:
【参考方案1】:定义不起作用?我猜你把focus
和hover
混淆了:
<a data-toggle="popover" title="توضیحات کاربر ارشد" data-content="Description"
data-trigger="hover">
popover
</a>
然后你的代码就可以工作了 -> http://jsfiddle.net/ehnnm5kk/
【讨论】:
【参考方案2】:您可以在引导程序 5 中使用相同但不同的语法。
<button type="button" class="btn btn-lg btn-danger"
data-bs-toggle="popover" data-bs-trigger="hover focus"
data-bs-content="And here's some amazing content. It's very engaging. Right?">
Click to toggle popover
</button>
【讨论】:
以上是关于如何为 dataTables 中的元素运行 popover?的主要内容,如果未能解决你的问题,请参考以下文章