Browse Source

Bug Fix: Slide width should'be included border width.

NaotoshiFujita 5 years ago
parent
commit
f1038d64f1

+ 2 - 4
dist/js/splide.js

@@ -3306,7 +3306,7 @@ var SLIDE_MAX_WIDTH = 5000;
     slideWidth: function slideWidth(index) {
       if (options.autoWidth) {
         var Slide = Elements.getSlide(index);
-        return Slide ? Slide.slide.clientWidth : 0;
+        return Slide ? Slide.slide.offsetWidth : 0;
       }
 
       var width = options.fixedWidth || (this.width + this.gap) / options.perPage - this.gap;
@@ -3687,8 +3687,7 @@ var THROTTLE = 100;
 
 
 
-var abs = Math.abs,
-    log = Math.log;
+var abs = Math.abs;
 /**
  * Adjust how much the track can be pulled on the first or last page.
  * The larger number this is, the farther the track moves.
@@ -5679,7 +5678,6 @@ var LIGHT = {
   Clones: components_clones,
   Layout: layout,
   Drag: drag,
-  Autoplay: components_autoplay,
   Arrows: components_arrows,
   Pagination: pagination,
   A11y: a11y

File diff suppressed because it is too large
+ 0 - 0
dist/js/splide.min.js


BIN
dist/js/splide.min.js.gz


+ 1 - 1
src/js/components/layout/directions/horizontal.js

@@ -124,7 +124,7 @@ export default ( Splide, Components ) => {
 		slideWidth( index ) {
 			if ( options.autoWidth ) {
 				const Slide = Elements.getSlide( index );
-				return Slide ? Slide.slide.clientWidth : 0;
+				return Slide ? Slide.slide.offsetWidth : 0;
 			}
 
 			const width = options.fixedWidth || ( ( this.width + this.gap ) / options.perPage ) - this.gap;

Some files were not shown because too many files changed in this diff