Bootstrap data-trigger =“focus”不起作用
问题描述:
如果我没有将data-trigger =“focus”作为其定义的一部分,那么在图标上定义的Bootstrap弹出窗口可以正常工作。当我包含它时,弹出窗口不会在我点击图标时显示。这是没有数据触发器的代码。Bootstrap data-trigger =“focus”不起作用
<a data-toggle="popover" data-placement="left" data-title="Membership history for Fred Smith" data-html="true" data-content="<table><thead><tr><th class='col-md-2 text-left'>Renewed</th><th>Expiration</th><th>Type</th></tr></thead><tbody><tr><td>12/09/2016</td><td>12/31/2017</td><td>1-Year Individual</td></tr></tbody></table>"><span class="glyphicon glyphicon-info-sign" style="color:grey;"></span></a>
而且包括数据触发代码:
<a data-toggle="popover" data-placement="left" data-trigger="focus" data-title="Membership history for Fred Smith" data-html="true" data-content="<table><thead><tr><th class='col-md-2 text-left'>Renewed</th><th>Expiration</th><th>Type</th></tr></thead><tbody><tr><td>12/09/2016</td><td>12/31/2017</td><td>1-Year Individual</td></tr></tbody></table>"><span class="glyphicon glyphicon-info-sign" style="color:grey;"></span></a>
我还要提到的是,图标是一个表格单元格中。
任何想法?
答
要在引导弹窗上使用data-trigger="focus"
属性,您需要使用tabindex="0"
。 这样的 - (编辑改的tabindex到TABINDEX)
<a tabindex="0" data-toggle="popover" data-placement="left" data-trigger="focus" data-title="Membership history for Fred Smith" data-html="true" data-content="<table><thead><tr><th class='col-md-2 text-left'>Renewed</th><th>Expiration</th><th>Type</th></tr></thead><tbody><tr><td>12/09/2016</td><td>12/31/2017</td><td>1-Year Individual</td></tr></tbody></table>"><span class="glyphicon glyphicon-info-sign" style="color:grey;"></span></a>
希望这有助于!
根据我的问题,弹出式工程不需要数据触发器,也不能用数据触发器打开。另外,根据我包含的代码,这不是一个按钮。 – Pete