UPDATE Flexslider has a bunch of callback spaces for use which make this possible.
after: function(){}, //Callback: function(slider) - Fires after each slider animation completes
Thanks everyone
LIVE CODE:
I uploaded the live code for debugging; for making a jsfiddles of this would be rather difficult.
Problem: The function fetchTitle() grabs the previous image title and not the most current?
Explanation: I have a function falled fetchTitles()
which takes a title tag from a the active slide from flexslider and places it into a varible targetTitle
. Then replaces h1.head_line
with the targetTitle
Script:(paired down from full script please view live code for full)
function fetchTitles() {
var targetTitle = $('.flex-active-slide').find('img').attr('title');
$('.head_line').text(targetTitle);
}
HTML
<li class="flex-active-slide">
<article class="active_work" title="Facebook + Like Pillow">
<figure> <img title="Facebook + Like Pillow" src="asset/img/1600/slide1_1600.jpg" />
<figcaption class="sliderCaptions">
<h1>
<div class="animate_text"></div>
<a href="https://plus.google.com/104865624796200130935/" ><span>Author:</span> Matthew Harwood</a></h1>
</figcaption>
</figure>
<section class="article_post"></section>
</article>
</li>
Addition Information:
- If you click on the links twice you'll see that the title will update itself.
- The fetch title on document ready comes up unidentified even tho there is an
.flex-active-slide
ready. - The scripts are at the bottom of the source in a
script2.js