我有一個Bootstrap彈出窗口,我正試圖放入一個表格,但是當它點擊時它不會顯示出來。這是第一次在popover中嘗試HTML,所以我不確定如何正確地做到這一點。謝謝!把表放入Bootstrap彈出窗口
$(function(){
$("[data-toggle=popover]").popover({
html : true,
content: function() {
var content = $(this).attr("data-popover-content");
return $(content).children(".popover-body").html();
},
title: function() {
var title = $(this).attr("data-popover-content");
return $(title).children(".popover-heading").html();
}
});
});
<a role="button" class="btn btn-link btn-item black-text" data-toggle="popover" data-trigger="focus" data-placement="top" title="Currency Converter" data-content="Displayed rates are only for informational purposes and do not reflect on the actual rates you may be charged by the financial institution handling your transaction.
<table class='table table-condensed table-bordered'>
<tr><td>Euro</td><td>€79,123</td></tr>
<tr><td>GB Pound</td><td>£46,536</td></tr>
<tr><td>AU $</td><td>$123,456</td></tr>
</table>LLC accepts payment in US Dollars only. Rates do not include taxes, duties, shipping, insurance, or any other expenses associated with the purchase."><i class="fa fa-exchange"></i> Currency converter</a>
我不知道是否這就是主要原因或沒有,但你缺少一個引號 - 「 - 在您的按鈕。在它說處理您的交易的最後。 – Skywalker
我覺得你試圖在HTML標籤內部嵌入HTML標籤,這至少是非常糟糕的做法。 – Jason
@ user2190986因爲內容仍然存在,所以此處沒有引號。 –