jQuery index finding
<div class="es-carousel">
<ul>
<li><a><img src="something157.jpg" ></a></li>
<li><img src="blabla.jpg"></a></li>
<li><img src="nonsense.jpg"></a></li>
<li><img src="cthulhu.jpg"></a></li>
</ul>
</div>
The html is above.
The jQuery selector I have for finding the img with the right src:
$(".es-carousel").find("ul li a img[src*='something']")
The problem is I need to find the index of the li that this image is in.
(I plan on use .index() for that) I have no idea how to select that
precise li which has that image.
Can anyone show me the right direction or give me an idea? All help is
appreciated.
No comments:
Post a Comment