简体   繁体   English

如何翻转Twitter Bootstrap的工具提示

[英]How to flip Twitter Bootstrap's Tooltips

I am using Twitter's Bootstrap to implement tooltips. 我正在使用Twitter的Bootstrap来实现工具提示。 Currently, the tooltips appear above the link. 目前,工具提示显示在链接上方。 I would like the tooltip to appear underneath the link. 我希望工具提示出现在链接下方。 How would I go about doing this? 我该怎么做呢?

I am triggering the tooltip and it clearly states "bottom" but it doesn't want to work for me... 我正在触发工具提示,它清楚地表明“底部”,但它不想为我工作......

<script>$('#home').tooltip('hide bottom')</script>
$('#tooltip').tooltip({
    placement : 'left',
    title : 'first tooltip'
});

Use this inside <script> tags, or in a separate JavaScript file. <script>标记内部或单独的JavaScript文件中使用此选项。

Assuming you're using the latest Bootstrap you would use the placement of "bottom". 假设您正在使用最新的Bootstrap,您将使用“bottom”的位置。 You can do this via the options when you create the tooltip: $("#tt").tooltip({placement: "bottom"}); 您可以在创建工具提示时通过选项执行此操作: $("#tt").tooltip({placement: "bottom"}); or via the data attribute on the element: <span data-placement="bottom" ...>tooltip!</span> I believe. 或者通过元素上的data属性: <span data-placement="bottom" ...>tooltip!</span>我相信。

You can find more information on the tooltip in the Bootstrap tooltip section. 您可以在Bootstrap工具提示部分中找到有关工具提示的更多信息。

on the bootstrap website they show options for the tooltips. 在bootstrap网站上,他们显示了工具提示的选项。 one of the options is placement which can be set to top, bottom, right or left. 选项之一是placement其可以被设置为顶部,底部,右或左。

so when you add the script for your tooltip put the option like this 因此,当您为工具提示添加脚本时,请选择此选项

$('#example').tooltip({placement: "bottom"})

Bootstrap tooltip has a "placement" option. Bootstrap工具提示有一个“放置”选项。 You can set it to "bottom" like this: 您可以将其设置为“bottom”,如下所示:

$('#home').tooltip({
    placement : "bottom"
});

See their official website for references ( v.2.3.3 ) or ( v.3 ). 有关参考资料( v.2.3.3 )或( v.3 ),请参阅其官方网站。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM