diff --git a/src/directives/rn-carousel.js b/src/directives/rn-carousel.js index 5e6d0e8..d07e9d2 100644 --- a/src/directives/rn-carousel.js +++ b/src/directives/rn-carousel.js @@ -227,7 +227,7 @@ angular.module('angular-carousel') window.addEventListener('orientationchange', resize); // when window is resized (responsive design) window.addEventListener('resize', resize); - + function resize () { updateContainerWidth(); updateSlidePosition(); @@ -256,7 +256,7 @@ angular.module('angular-carousel') /* trigger carousel position update */ skipAnimation = !!forceSkipAnimation || skipAnimation; if (containerWidth===0) updateContainerWidth(); - offset = scope.carouselCollection.getRelativeIndex() * -containerWidth; + offset = Math.round(scope.carouselCollection.getRelativeIndex() * -containerWidth); if (skipAnimation===true) { carousel.removeClass('rn-carousel-animate') .addClass('rn-carousel-noanimate')