我如何调整某个元素的引导程序工具提示的位置? [英] How do i adjust the position of a Bootstrap's Tooltip for a certain element?

查看:107
本文介绍了我如何调整某个元素的引导程序工具提示的位置?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有这些按钮/锚在这里和一引导由工具提示:

I have these buttons/anchors right here and a Bootstrap made tooltip :

<a id="btn1" class="mybutton" data-container="body" data-toggle="tooltip" data-placement="right" title="my tooltip">
    Hover Me To Display Tooltip
</a>

<a id="btn2" class="mybutton" data-container="body" data-toggle="tooltip" data-placement="right" title="my tooltip">
    Hover Me To Display Tooltip
</a>

并将其与jQuery代码结合:

and combine it with the jQuery code which is this :

$(document).ready(function(){
    $(".mybutton").tooltip();
});

它可以很好地工作,显示右侧的工具提示。

it will work perfectly fine, displaying the tooltip on the right.

但我怎样才能改变只使用CSS的button1的工具提示的位置,以便我可以将它进一步移动到正确的位置?而不移动button2的工具提示?

but how can i change the position of the tooltip of only button1 using CSS, so that i can move it further to the right? without moving the button2's tooltip?

推荐答案

应用 data-placement =right数据属性到你想要改变toolip位置的元素;

Apply data-placement="right" data attribute to the element where you want to change position of toolip;

你也可以设置。 top left , right bottom , auto

You can also set. top ,left,right,bottom,auto.

如果您想了解更多关于工具提示的信息,检查引导工具提示设置

If you want more about tooltip. Check bootstrap tooltip settings

这篇关于我如何调整某个元素的引导程序工具提示的位置?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆