Is there any way to traverse the DOM in a circle? Like, when you get to the end of the list, it loops back around to the beginning?
Here's an example, which does not work, but will hopefully illustrate the effect I would like to achieve:
<ul>
<li></li>
<li></li>
<li></li>
<li class="four"></li>
</ul>
$('li.four').next().addClass('one');