Twitterブートストラップからポップオーバーコンポーネントを実装しようとしています:
$('.popover-button').popover({
html: true,
placement: 'bottom',
content: $(this).data('content-id')
});
<button class="popover-button" data-content-id="div1">Click 1</button>
<button class="popover-button" data-content-id="div2">Click 2</button>
<button class="popover-button" data-content-id="div3">Click 3</button>
<div class="div1">Hello 1</div>
<div class="div2">Hello 2</div>
<div class="div3">Hello 3</div>
しかし、それは機能していません。すべてのボタンを反復処理している場合、通常のように $(this) を使用できないようです。
では、これを行う方法は?