Advice for traversal scenario

Advice for traversal scenario

I'm wondering if anyone has advice for how to locate prev and next '.trigger' items in a UL like this:

  1. <ul>
     <li><a href="#slide1" class="trigger">Slide 1</a></li>
     <li><a href="#slide2" class="trigger">Slide 2</a></li>
     <li><a href="#slide3">Slide 3</a></li>
     <li><a href="#slide4" class="trigger current">Slide 4</a></li>
     <li><a href="#slide5" class="trigger">Slide 5</a></li>
     <li><a href="#slide6" class="trigger">Slide 6</a></li>
    </ul>

    <a href="#" class="prev">Prev</a>
    <a href="#" class="next">Next</a>

I've got click handlers for the a.prev and a.next links. If a user clicks Prev, I find the A tag in the UL that has the .current class, then I want to know the href value of the first a.trigger element that is before it. So if .current is Slide 4, I want to get #slide2. And if .current is Slide 2 and the user clicks Next, I want to get #slide4. It has to work regardless of the mixture of .trigger and not .trigger links. I always need either the first trigger before the .current item or the next trigger after it.

Any advice? I'd like to think I can do this without having to make an ancillary array and tracking things through that, because the LI's may dynamically be added/removed.

Thanks,
Jack