robieee
robieee

Reputation: 364

Twitter bootstrap tooltip is not working

I am facing following error while I am trying to use Twitter bootstrap ToolTip.

Uncaught Error: cannot call methods on tooltip prior to initialization; attempted to call method 'show'

Javascript code is :

$("#exclamation-sign").tooltip('show');

Upvotes: 0

Views: 786

Answers (1)

Vidya
Vidya

Reputation: 30300

As described in the documentation, you need to initialize the tooltips before calling methods on them.

So you need to do, for example

$("#exclamation-sign").tooltip({ 'animation': true, 'title': 'My Tooltip' });

To initialize it. The options are described in the table right there in the documentation.

Then when you're ready,

$("#exclamation-sign").tooltip('show');

Upvotes: 2

Related Questions