Recently, I came across this code snippet:
$(document).ready(function(){
$('.porslider > .slides > li > div > ul > li').click(function() {
var which = $(this).index();
$('#big').find('div').hide().eq(which).show();
});
});
It works perfectly when clicking on an li item to display a corresponding div. However, the issue arises when trying to implement this in a flexslider. Here is a snippet of my HTML structure:
<div class="flexslider porslider">
<ul class="slides">
<li>
<div>
<ul class="porimages ulpor">
<li><a><img src="por_small/piWD00001.png" alt="" height="142" width="142"/></a></li>
<li class="mr"><a><img src="por_small/piWD00001.png" alt="" height="142" width="142"/></a></li>
<li><a><img src="por_small/piWD00001.png" alt="" height="142" width="142"/></a></li>
<li class="mr"><a><img src="por_small/piWD00001.png" alt="" height="142" width="142"/></a></li>
<li><a><img src="por_small/piWD00001.png" alt="" height="142" width="142"/></a></li>
</ul>
</div>
</li>
<li>
<div>
<ul class="porimages ulpor">
<li><a><img src="por_small/piWD00001.png" alt="" height="142" width="142"/></a></li>
<li class="mr"><a><img src="por_small/piWD00001.png" alt="" height="142" width="142"/></a></li>
<li><a><img src="por_small/piWD00001.png" alt="" height="142" width="142"/></a></li>
<li class="mr"><a><img src="por_small/piWD00001.png" alt="" height="142" width="142"/></a></li>
<li><a><img src="por_small/piWD00001.png" alt="" height="142" width="142"/></a></li>
</ul>
</div>
</li>
</ul>
</div>
<div id="big">
<div><img src="por_big/piWD00001.png" /></div>
<div><img style="opacity: 0.5;" src="por_big/piWD00001.png" /></div>
<div><img style="border: 2px solid red;" src="por_big/piWD00001.png" /></div>
<div><img src="por_big/piWD00001.png" /></div>
<div><img src="por_big/piWD00001.png" /></div>
<div><img src="por_big/piWD00001.png" /></div>
<div><img style="opacity: 0.1;" src="por_big/piWD00001.png" /></div>
<div><img style="border: 2px solid blue;" src="por_big/piWD00001.png" /></div>
<div><img src="por_big/piWD00001.png" /></div>
<div><img src="por_big/piWD00001.png" /></div>
</div>
This CSS rule is applied:
#big div {
display: none;
}
I am looking for suggestions or solutions on how to modify the script to work with multiple slides. Currently, only the first five thumbnails are visible but I would like to display more. Any ideas on how to achieve this?
Thank you!