I'm not exactly what I'm looking for in jQuery/Javascript terms. The behavior I'm looking for is akin to your typical lightbox slide show with the following elements:
- a list of items
- clicking on an item will bring up a new element that references the item in the list
- while the new element includes next/prev navigation that refers back to the list of items.
I'm building something like that and am looking for the technical approach for handling the above.
I have this for sample code:
<ul>
<li><a href="samplelink.html">item 1</a></li>
<li><a href="anotherlink.html">item 2</a></li>
<li><a href="onemorelink.html">item 3</a></li>
</ul>
I have things set up so that each LI A gets a click event that creates a new overlay DIV on the page, then does a .load($(this).attr('href)) into it.
All that works great.
What I don't know how to do is, pass which index of LI I clicked on to the new div so I can add the proper prev/next links and actually refer to the next/prev element in the original list. Specific example, if I click on the second list item, in the new DIV I create, how do I pass into it the information that "it was the second link that opened this".