Skip to content

Commit

Permalink
reset the position of the slides each time an image is loaded
Browse files Browse the repository at this point in the history
  • Loading branch information
davidghi committed Jul 9, 2016
1 parent 09499ff commit 65bc884
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions src/js/jquery.sliderPro.core.js
Original file line number Diff line number Diff line change
Expand Up @@ -375,13 +375,13 @@
this.slides.splice( index, 0, slide );

slide.on( 'imagesLoaded.' + NS, function( event ) {
if ( that.settings.autoSlideSize === true ) {
if ( that.$slides.hasClass( 'sp-animated' ) === false ) {
that._resetSlidesPosition();
}
that._calculateSlidesSize();
} else if ( that.settings.autoHeight === true && event.index === that.selectedSlideIndex ) {
if ( that.$slides.hasClass( 'sp-animated' ) === false ) {
that._resetSlidesPosition();
}

that._calculateSlidesSize();

if ( that.settings.autoHeight === true && event.index === that.selectedSlideIndex ) {
that._resizeHeightTo( slide.getSize().height);
}
});
Expand Down

0 comments on commit 65bc884

Please sign in to comment.