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

php - regexp cyrillic filename not matches -

c# - OpenXML hanging while writing elements -

sql - Select Query has unexpected multiple records (MS Access) -