Siddharth
Siddharth

Reputation: 893

Placing a twitter bootstrap tooltip on the right side

I want to display a tooltip using twitter bootstrap in rails. The tooltip is to be displayed on page load. So for doing this I have added the following in my markup of the field:

rel="tooltip" title="Press CTRL+C To Copy"

And then I have added the following code into my application.js file:

window.onload = function(){
var text_input = document.getElementById ('url_copy');
text_input.focus ();
text_input.select ();
$('#url_copy').tooltip('show')
}

Fortunately it's displaying the tooltip. Nut unfortunately it's displaying it on the top. But I want to place it on right. I know I have to use a placement: 'right' or something like that as mentioned http://twitter.github.com/bootstrap/javascript.html#tooltips

But how should the code exactly look like??

Thanks in Advance...

Upvotes: 1

Views: 4261

Answers (1)

CharliePrynn
CharliePrynn

Reputation: 3080

On the page that you linked it shows you examples.

To place it on the right use the following html.

<a href="#" rel="tooltip" data-placement="right" data-original-title="Tooltip on right">Tooltip on right</a>

http://twitter.github.com/bootstrap/javascript.html#tooltips

Upvotes: 3

Related Questions