JQuery脚本干扰另一个脚本

时间:2014-08-12 21:30:43

标签: javascript jquery html

我有一个简单的html表,我下载了2个jquery插件,一个是固定标头,另一个是使表可排序。他们独立工作很好,但问题是我试图让他们一起工作。只有FixedHeader功能正常工作。 我将不胜感激任何帮助!

我需要帮助,我不知道还能做什么:

<script src="{!URLFOR($Resource.SortingColumns, '/__jquery.tablesorter/jquery-latest.js')}"></script>
<script src="{!URLFOR($Resource.SortingColumns, '/__jquery.tablesorter/jquery.tablesorter.js')}"></script>
<script src="{!URLFOR($Resource.FixHeader,'/Fixed-Header/jquery.fixedheadertable.js')}"/>
<script>  
    // Use full jQuery function name to reference jQuery.
    jQuery( document ).ready(function() {
        jQuery("#table-2").fixedHeaderTable({ height: 200 });
        jQuery("#table-2").fixedHeaderTable({ themeClass: 'mytable' }); 
    });
    window.onload = function() {
        $("#table-2").tablesorter(); 
        $("#table-2").tablesorter( {sortList: [[0,0], [1,0]]} ); 
    };
 </script>

表格结构:

<table id="table-2" class="mytable">
    <thead>
        <tr>
            <th></th>                                
            <th></th>
        </tr>
    </thead>
    <tbody>
        <tr>
            <td></td>
            <td></td>
        </tr>
    </tbody>
</table>

0 个答案:

没有答案