初始化后如何更改 Twitter-Bootstrap 工具提示放置的位置? [英] How to change placement of Twitter-Bootstrap tooltip placement after initialization?

查看:36
本文介绍了初始化后如何更改 Twitter-Bootstrap 工具提示放置的位置?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在文本框初始化后更改 Bootstrap 工具提示的位置:

I want to change placement of a Bootstrap tooltip on a text box after it has been already initialized:

// these don't work
$('#myTextbox').tooltip({ placement: 'left' });
$('#myTextbox').tooltip('options', 'placement', 'right' });

有什么办法吗?如果是这样,我做错了什么?

Is there any way to do it? If so, what am I doing wrong?

推荐答案

在 Bootstrap 2.x 中,答案是 ajbeaven 状态:

In Bootstrap 2.x, the answer is as ajbeaven states:

$('#myTextbox').data('tooltip').options.placement = 'right';

但是,从 Bootstrap 3 开始,所有 Bootstrap 数据都使用 bs 命名空间:

However, from Bootstrap 3, all Bootstrap data is namespaced with bs:

$('#myTextbox').data('bs.tooltip').options.placement = 'right';

这篇关于初始化后如何更改 Twitter-Bootstrap 工具提示放置的位置?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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