【发布时间】:2020-09-30 21:03:48
【问题描述】:
假设我的网站上有一个 Bootstrap Popover,如下所示:
HTML:
<button type="button" class="btn btn-secondary" data-container="body" data-toggle="popover" data-placement="top"
data-content="Insert the very large instructions to a game that participants need a reminder on how to play here. Insert the very large instructions to a game that participants need a reminder on how to play here. Insert the very large instructions to a game that participants need a reminder on how to play here. Insert the very large instructions to a game that participants need a reminder on how to play here. Insert the very large instructions to a game that participants need a reminder on how to play here. Insert the very large instructions to a game that participants need a reminder on how to play here.">
</button>
脚本:
$(function () {
$('[data-toggle="popover"]').popover()
})
但是,由于 Popover 的内容会很长,有没有办法让 popover 在屏幕上居中并重新调整大小以占据屏幕总面积的 75%?也许 Popover 不是完成这项工作的正确工具,在这种情况下,我会感谢有关使用更好组件的指导。
【问题讨论】:
标签: javascript html jquery css twitter-bootstrap