Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/jquery/71.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Jquery 数据僵尸列表索引_Jquery_Cordova_Jqtouch - Fatal编程技术网

Jquery 数据僵尸列表索引

Jquery 数据僵尸列表索引,jquery,cordova,jqtouch,Jquery,Cordova,Jqtouch,我正在使用jqtouch的DataZombies分支创建一个索引列表。我包括扩展脚本和css,并按照以下内容使用标记: <div class="s-scrollwrapper indexed"> <ul id="county-list" class="edgetoedge"> <li id="A" class="sep" >A</li> <li>test A</li>

我正在使用jqtouch的DataZombies分支创建一个索引列表。我包括扩展脚本和css,并按照以下内容使用标记:

<div class="s-scrollwrapper indexed">    
    <ul id="county-list" class="edgetoedge">
        <li id="A" class="sep" >A</li>
        <li>test A</li>
        <li id="B" class="sep" >B</li>
        <li>test B</li>
        <li id="C" class="sep" >C</li>
        <li>test C</li>
        <li id="D" class="sep" >D</li>
        <li>test D</li>
    </ul>
</div>

……但它不起作用。右边下方的索引仍然出现,分隔符li的样式都很好,但它不起作用。有什么建议吗?

我解决这个问题的方法是创建一个清除列表指示数据的函数。调用此函数,然后在调用initListIndexes()之前将索引类重新添加到列表包装器中,似乎可以解决此问题

function clearListIndices() {
    // for each element with the class of .indexed
    $('body').find('.indexed').each(function(){
        // reset the listIndex data associated with this element
        $(this).data('listIndex', null);
        // removed the class to avoid multiple instances of the class    
        $(this).removeClass('indexed');     
    });

    // for each listIndex ul
    $('body').find('.listIndex').each(function(){
        // remove this from the DOM
        $(this).remove(); 
    });
}
function clearListIndices() {
    // for each element with the class of .indexed
    $('body').find('.indexed').each(function(){
        // reset the listIndex data associated with this element
        $(this).data('listIndex', null);
        // removed the class to avoid multiple instances of the class    
        $(this).removeClass('indexed');     
    });

    // for each listIndex ul
    $('body').find('.listIndex').each(function(){
        // remove this from the DOM
        $(this).remove(); 
    });
}