【问题标题】:Bootstrap 4 tether placementsBootstrap 4 系绳放置
【发布时间】:2016-06-09 07:55:45
【问题描述】:

Bootstrap 4 使用 tether.js 作为位置,但是它只支持 4 个位置,“top”“right”“bottom”“left”,我怎样才能扩展到更多选项,tether 支持其中的 12 个?例如“左上”或“右上”

【问题讨论】:

标签: javascript twitter-bootstrap-4 bootstrap-4 tether


【解决方案1】:

似乎引导程序只接受4 placement options - 检查打开的github issue

目前 bootstrap 仅支持 4 个放置选项,而 Tether 支持 12 个。

因此,使用引导工具提示对您没有帮助,但您始终可以使用 tether.jstooltip.js

这是一个使用tooltip.js的例子:

new Tooltip({
  target: document.getElementById('foobar'),
  position: 'right middle',
  content: '<div id="foo">bar</div>',
});
#foo{
  background-color: black;
  color: red;
}
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<link href="https://cdnjs.cloudflare.com/ajax/libs/tether-tooltip/1.2.0/css/tooltip-theme-arrows.min.css" rel="stylesheet"/>
<script src="https://cdnjs.cloudflare.com/ajax/libs/tether/1.3.2/js/tether.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/tether-drop/1.4.2/js/drop.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/tether-tooltip/1.2.0/js/tooltip.min.js"></script>

<a href=# id="foobar">I'm a link!</a>

这里也是the fiddle

【讨论】:

    猜你喜欢
    • 2016-10-23
    • 2018-09-03
    • 1970-01-01
    • 1970-01-01
    • 2017-10-04
    • 1970-01-01
    • 1970-01-01
    • 2018-03-03
    • 2018-12-30
    相关资源
    最近更新 更多