简体   繁体   中英

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');

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');

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM