02.06.2015 Views

Bootstrap Tutorial

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

animation<br />

boolean<br />

Default: true<br />

dataanimation<br />

Applies a CSS fade transition to the tooltip.<br />

Html<br />

boolean<br />

Default: false<br />

data-html<br />

Inserts HTML into the tooltip. If false, jQuery’s text method will be<br />

used to insert content into the dom. Use text if you’re worried about<br />

XSS attacks.<br />

placement<br />

string|function<br />

Default: top<br />

dataplacement<br />

Specifies how to position the tooltip (i.e., top|bottom|left|right|auto).<br />

When auto is specified, it will dynamically reorient the tooltip. For<br />

example, if placement is "auto left", the tooltip will display to the left<br />

when possible, otherwise it will display right.<br />

selector<br />

string<br />

Default: false<br />

data-selector<br />

If a selector is provided, tooltip objects will be delegated to the<br />

specified targets.<br />

Title<br />

string | function<br />

Default: "<br />

data-title<br />

The title option is the default title value if the title attribute isn’t<br />

present.<br />

Trigger<br />

string<br />

Default: 'hover<br />

focus'<br />

data-trigger<br />

Defines how the tooltip is triggered: click| hover | focus | manual.<br />

You may pass multiple triggers; separate them with a space.<br />

content<br />

string | function<br />

Default: ''<br />

data-content<br />

default content value if data-content attribute isn't present<br />

Delay<br />

number | object<br />

Default: 0<br />

data-delay<br />

Delays showing and hiding the tooltip in ms — does not apply to<br />

manual trigger type. If a number is supplied, delay is applied to<br />

both hide/show. Object structure is:<br />

delay:<br />

{ show: 500, hide: 100 }<br />

container<br />

Methods<br />

string | false<br />

Default: false<br />

datacontainer<br />

The following are some useful methods for tooltips:<br />

Appends the tooltip to a specific element.<br />

Example: container: 'body'<br />

Method Description Example<br />

Options:.tooltip(options)<br />

Attaches a tooltip handler to an element<br />

collection.<br />

$().tooltip(options)<br />

Toggle:.tooltip('toggle') Toggles an element's tooltip. $('#element').tooltip('toggle')<br />

Show:.tooltip('show') Reveals an element's tooltip. $('#element').tooltip('show')<br />

Hide: .tooltip('hide') Hides an element's tooltip. $('#element').tooltip('hide')<br />

Destroy:.tooltip('destroy') Hides and destroys an element's tooltip. $('#element').tooltip('destroy')<br />

TUTORIALS POINT<br />

Simply Easy Learning

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!