문제

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