diff --git a/jquery.flexslider.js b/jquery.flexslider.js index 39546730..3f4f9f3a 100644 --- a/jquery.flexslider.js +++ b/jquery.flexslider.js @@ -594,7 +594,8 @@ } }, uniqueID: function($clone) { - $clone.find( '[id]' ).each(function() { + // Append _clone to current level and children elements with id attributes + $clone.filter( '[id]' ).add($clone.find( '[id]' )).each(function() { var $this = $(this); $this.attr( 'id', $this.attr( 'id' ) + '_clone' ); }); @@ -882,9 +883,8 @@ slider.cloneOffset = 1; // clear out old clones if (type !== "init") slider.container.find('.clone').remove(); - // slider.container.append(slider.slides.first().clone().addClass('clone').attr('aria-hidden', 'true')).prepend(slider.slides.last().clone().addClass('clone').attr('aria-hidden', 'true')); - methods.uniqueID( slider.slides.first().clone().addClass('clone').attr('aria-hidden', 'true') ).appendTo( slider.container ); - methods.uniqueID( slider.slides.last().clone().addClass('clone').attr('aria-hidden', 'true') ).prependTo( slider.container ); + slider.container.append(methods.uniqueID(slider.slides.first().clone().addClass('clone')).attr('aria-hidden', 'true')) + .prepend(methods.uniqueID(slider.slides.last().clone().addClass('clone')).attr('aria-hidden', 'true')); } slider.newSlides = $(slider.vars.selector, slider);