The following element is found according to its index.
var listDiv = $( "div[class*='item-title']" ).filter(function( index ) {
return index === curActiveItem
});
In this case, it appears that jQuery would continue to search the selected elements as having the index passed into the filter.
Is there a way to use ":first" with this example, or is there a more efficient way to filter the items?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…