I have an image scroller set up, and I keep a count of the current item through a variable called current_item. Now, I want to display the alt text of the image in a list of images whose index matches the item_count.
Here's the JQuery
var scroll_text = $('#ax_campaign_content li').index(current_item).children('img').attr('alt');
$('#ax_campaign_scroller h4').text(scroll_text);
And this is the basic html structure:
<div id="ax_campaign_content">
<ul>
<li><img alt="Image 1"></li>
<li><img alt="Image 2"></li>
</ul>
</div>
<div id="ax_campaign_scroller">
<h4>Image Text Goes Here</h4>
</div>
This is what I'm trying to do but it's not working. Anybody see where I'm going wrong?