PS: I am using this Jquery plugin, although my question is not dependent on that.
<div class="pikachoose">
<ul id="pikame" class="jcarousel-skin-pika">
<li><a href="http://www.pikachoose.com"><img src="../../10.jpg"/></a</li>
<li><a href="http://www.pikachoose.com"><img src="../../20.jpg"/></a></li>
<li><a href="http://www.pikachoose.com"><img src="../../30.jpg"/></a</li>
<li><a href="http://www.pikachoose.com"><img src="../../40.jpg"/></a></li>
<li><a href="http://www.pikachoose.com"><img src="../../50.jpg"/></a></li>
</ul>
</div>
I want to get the index of “li” tag clicked.
$("#pikame li").size();
will return me total number of “li”. But i want to get index of that “li”
Like if image 40.jpg is clicked then i want to get 3(index starting from 0,1,2 so on…).
Working example: http://jsfiddle.net/AlienWebguy/zvkgv/
EDIT: Expanded example per comment request:
New Working example: http://jsfiddle.net/AlienWebguy/zvkgv/2/