Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to change placement of Twitter-Bootstrap tooltip placement after initialization?

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?

like image 810
ajbeaven Avatar asked Apr 16 '12 21:04

ajbeaven


1 Answers

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

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

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

$('#myTextbox').data('bs.tooltip').options.placement = 'right';
like image 159
Ben Cox Avatar answered Sep 25 '22 06:09

Ben Cox