It turns out that Evan Larsen has the best answer . Please support his answer (and / or select it as the correct answer) - he is brilliant.
JsFiddle works here
Using the Evan trick, you can create all the hints with a single line of code:
$('[data-toggle="tooltip"]').tooltip({'placement': 'top'});
You will see that all tooltips in your long paragraph have working tooltips with only one line.
In the jsFiddle example (link above), I also added a situation where one hint is enabled by default (by the login button). Additionally, tooltip code is added to the button in jQuery, not HTML markup.
Popovers work the same as tooltips:
$('[data-toggle="popover"]').popover({trigger: 'hover','placement': 'top'});
And here it is! Success at last.
One of the biggest problems in calculating this stuff was to start bootstrap using jsFiddle ... Here's what you have to do:
- Get a link for Twitter Bootstrap CDN from here: http://www.bootstrapcdn.com/
- Paste each link into notepad and cross out ALL except the URL. For example:
//netdna.bootstrapcdn.com/bootstrap/3.0.0/css/bootstrap.min.css
- In jsFiddle, on the left side, open the external resources accordion drop-down list
- Paste into each URL by clicking the plus sign after each paste
- Now open the Frames and Extensions accordion drop-down menu and select jQuery 1.9.1 (or whatever ...)
NOW, you are ready to go.
gibberish Aug 30 '13 at 16:31 2013-08-30 16:31
source share