我有一些元素可以在文档中声明为可排序。后来在函数中,我使用toArray将它们放入数组中。我想要做的事情是遍历这个数组,并获得那些我正在寻找的具有特定元素的元素。我打开数组并使用.find,但它说元素myarray [index]没有方法查找,所以然后我尝试myarray.eq(index).find,然后它说他们没有方法eq。任何帮助,这将不胜感激。我的代码如下。对象没有方法eq或找到
var imageBlocks = $(".imageBlocks").sortable("toArray");
images = Array();
for(i = 0; i < imageBlocks.length ; i++)
{
image = imageBlocks.eq(i).find(".post_image");
if(image.length > 0){
images.push(image);
}
}
你的变量是'imageBlocks'不是'$ imageBlocks ' – 2013-02-18 17:50:13
'imageBlocks!== $ imageBlocks' – 2013-02-18 17:50:38