javascript - bxSlider onSlideBefore - Doesn't work after first pass through -


i'm working on slideshow using bxslider , onslidebefore callback. while works on first iteration of slider, function fails on subsequent visits specific slide, or on second (and on) iteration through slides.

here's code in question:

$(document).ready(function(){     var slider = $('.slider').bxslider({         auto:true,         mode: 'fade',     pause:8000,     captions:false,     controls:true,     onsliderload: function(){         var caption = $('#0 .caption').contents();                       $(".imagecaption").html(caption);             },           onslidebefore: function(){             var caption = '#';             caption += slider.getcurrentslide();         caption += ' .caption';         var cap = $(caption).contents();         $(".imagecaption").html(cap);         },         });  }); 

example on jsfiddle

essentially happening jquery pulling contents out of div , placing in div b.

i wanted copied, retained in div a. replacing .contents() .html() fixed issue.


Comments

Popular posts from this blog

html - Sizing a high-res image (~8MB) to display entirely in a small div (circular, diameter 100px) -

java - IntelliJ - No such instance method -

identifier - Is it possible for an html5 document to have two ids? -