Вопрос

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