javascript - Backstretch copy output from loop to a DIV -
i have full screen background slideshow powered backstretch script. i'm trying create caption each slide , display information in
<span class="cap"></span>
inside of
<div class="caption"></div>
the span part of list populates slideshow , hidden.
here jsfiddle of have far.
thanks advice or help.
you can use backstretch.show
event suggest in fiddle cap
element array.
backstretch fire "backstretch.show" event everytime new image loads, triggering function passed event , backstetch instance. if listen event, can, example, coordinate other changes coincide slideshow.
code:
// coordinating image captions slides $(b).on('backstretch.show', function() { $(this).data("backstretch").index; $(".caption").html(cap[$(this).data("backstretch").index].html()); });
here working fiddle: http://jsfiddle.net/g84hk/9/
Comments
Post a Comment