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?

没有正确的解决方案

其他提示

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/

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top