Hello, I am fairly new to web development and could use some professional assistance. I have a slideshow set up, but I am struggling with adding the filename of the next or previous images to the back/forward icons of the slideshow. Is this achievable with the current code setup? Here is an image to illustrate my point: example
HTML:
<div id="container">
<ul>
<li><img src=""></li>
<li><img src=""></li>
</ul>
<span class="button prevButton"></span>
<span class="button nextButton"></span>
</div>
JS:
$(window).load(function(){
var pages = $('#container li'), current=0;
var currentPage, nextPage;
$('#container .button').click(function(){
currentPage = pages.eq(current);
if($(this).hasClass('prevButton'))
{
if (current <= 0)
current = pages.length-1;
else
current = current-1;
}
else
{
if (current >= pages.length-1)
current = 0;
else
current = current + 1;
}
nextPage = pages.eq(current);
currentPage.hide();
nextPage.show();
});
});