CFdump和Bootstrap工具提示互相争斗

时间:2014-02-25 17:01:43

标签: coldfusion twitter-bootstrap-3 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>

有没有办法保持,两人踩在一起?

1 个答案:

答案 0 :(得分:2)

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

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

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

同样,它确实无关紧要,因为你不应该在生产代码中使用cfdump。

您可以在此处查看此操作:http://jsfiddle.net/seancoyne/rc7TL/