From 1264cb714057188c743fad416ffaef35bc0b9d2d Mon Sep 17 00:00:00 2001 From: Mark Otto Date: Sun, 15 Dec 2013 11:41:46 -0800 Subject: [PATCH] update tooltip docs --- javascript.html | 23 ++++++++++++++++------- 1 file changed, 16 insertions(+), 7 deletions(-) diff --git a/javascript.html b/javascript.html index b693eaaf9f..ee83242454 100644 --- a/javascript.html +++ b/javascript.html @@ -904,6 +904,12 @@ $('a[data-toggle="tab"]').on('shown.bs.tab', function (e) { +{% highlight html %} + + + + +{% endhighlight %}

Opt-in functionality

@@ -926,9 +932,17 @@ $('#example').tooltip(options) {% endhighlight %}

Markup

-

The generated markup of a tooltip is rather simple, though it does require a position (by default, set to top by the plugin).

+

The required markup for a tooltip is only a data attribute and title on the HTML element you wish to have a tooltip. The generated markup of a tooltip is rather simple, though it does require a position (by default, set to top by the plugin).

+
+

Multiple-line links

+

Sometimes you want to add a tooltip to a hyperlink that wraps multiple lines. The default behavior of the tooltip plugin is to center it horizontally and vertically. Add white-space: nowrap; to your anchors to avoid this.

+
{% highlight html linenos %} -
+ +Hover over me + + +
Tooltip!
@@ -1011,11 +1025,6 @@ $('#example').tooltip(options)

Options for individual tooltips can alternatively be specified through the use of data attributes, as explained above.

-

Markup

-{% highlight html %} -Hover over me -{% endhighlight %} -

Methods

$().tooltip(options)