¡@

Home 

2014/10/16 ¤W¤È 12:05:46

jquery Programming Glossary: nextindex

jQuery: How to use each starting at an index other than 0

http://stackoverflow.com/questions/4760734/jquery-how-to-use-each-starting-at-an-index-other-than-0

the outer loop runs I want to start in the each at the element after the one I returned at. A generic code example var nextIndex 0 for var j 1 j someCount j do outside loop stuff '#someElemID' .find '.someClass' .each function index if this is right.. function index if this is right one do something next index should get passed to each function next loop... somehow nextIndex index 1 return false I thought about switching to a for loop but then I got confused as to how to access the return from.. each share improve this question Use slice http api.jquery.com slice '#someElemID' .find '.someClass' .slice nextIndex .each ... btw if the elements are static consider caching var elms '.someClass' '#someElemID' nextIndex 0 for var j 1 j..