JavaScript to Active Twitter Bootstrap Tooltips

后端 未结 4 1956
情话喂你
情话喂你 2021-02-20 08:47

I\'m playing around with Twitter Bootstrap\'s Tooltips, but am having problems since they moved away from Twipsy. The correect JavaScript is included in the page.

Let\'s

4条回答
  •  情深已故
    2021-02-20 09:24

    For your example it will just be:

    $('a').tooltip();
    

    but according to the documentation, you should use the title attribute, not data-original-title. That attribute is added by Bootstrap's tooltip code. Also there is no need for rel="tooltip".

    Your code should be:

    HTML:

    hover on me
    

    JS:

    $("a").tooltip(); // this will trigger a tooltip on all  elements
    

提交回复
热议问题