CFdump和Bootstrap工具提示相互冲突



我通过附加引导工具提示

$("[title]").tooltip({ html: true });

当我使用<cfdump>时,标题标签会贴得到处都是。<cfdump>html的开头看起来像这个

<table class="cfdump_struct">
<tr><th class="struct" colspan="2" onClick="cfdump_toggleTable(this);" style="cursor:pointer;" title="click to collapse">struct</th></tr> 
<tr>
<td class="struct" onClick="cfdump_toggleRow(this);" style="cursor:pointer;" title="click to collapse">Cause</td>
<td>

有没有办法阻止这两个人互相践踏?

您不应该在意,因为cfdump不应该在生产中使用,但是您可以减少jQuery选择器返回的数组。不确定这是否是最好的方法,但它有效:

$("[title]").filter(function(){
return ($(this).closest(".cfdump_struct").length == 0);
}).tooltip({ html: true });

它为选择器返回的数组中的每个项运行filter函数。如果它在CFDUMP表中(由.CFDUMP_struct类表示),它不会返回它。您必须将其扩展到其他CFDUMP类型(查询等),但这应该让您开始。

同样,这其实并不重要,因为无论如何都不应该在生产代码中使用cfdump。

你可以在这里看到这一点:http://jsfiddle.net/seancoyne/rc7TL/

最新更新