In the old days, bootstrap's popover had a "live" option which allowed us to make the $('.myclass').popover({live: true})
call even before the DOM elements existed. I looked at the docs for 2.2 and this seems to be gone. What's the new way to do it?
Default title value if title attribute isn't present. If a function is given, it will be called with its this reference set to the element that the popover is attached to. How popover is triggered - click | hover | focus | manual. You may pass multiple triggers; separate them with a space.
To make the image on hover in popover just insert an image as an HTML element to the data-mdb-content and set the data-mdb-html to true .
To create a popover, add the data-toggle="popover" attribute to an element. Note: Popovers must be initialized with jQuery: select the specified element and call the popover() method.
The data-toggle attribute defines the Popover, the title attribute defines the Tile for the Popover and the data-content attribute is used to store the content to be displayed in the respective Popover.
The live mode is not used any more.
The Bootstrap JS plugins now use delegated events via the jQuery .on method. You can supply an event delegation target selector pointing to an element which might or might not exist.
$('.some-container').popover({
selector: '.has-popover'
});
Working example generating DOM elements with popover attached: http://jsfiddle.net/asKF9/
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With