Question

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?

No correct solution

OTHER TIPS

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/

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top