How do I select the next \"n\" elements starting from the current element? What I mean is...
$(this).attr(...);
I want to do this \"n\" times
$(this).slice(start_index, end_index) will select a portion of your selection. You could keep track of your current index in the loop and then apply the .slice(cur_index, cur_index+n) function on the original set when you hit your condition.
$(this).slice(start_index, end_index)
.slice(cur_index, cur_index+n)