Skip to content

Commit

Permalink
Fix slideToScroll auto bug and update documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
NickPiscitelli committed Nov 11, 2018
1 parent 706c7e6 commit df0a531
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 11 deletions.
8 changes: 4 additions & 4 deletions docs/assets/js/glider.js
Original file line number Diff line number Diff line change
Expand Up @@ -88,10 +88,10 @@
if (!paging) paging = breakpointChanged;

if (_.opt.slidesToShow === 'auto'){
_.opt.slidesToShow = Math.floor(_.containerWidth / _.opt.itemWidth)
if (_.opt.slidesToScroll === 'auto'){
_.opt.slidesToScroll = _.opt.slidesToShow;
}
_.opt.slidesToShow = Math.floor(_.containerWidth / _.opt.itemWidth);
}
if (_.opt.slidesToScroll === 'auto'){
_.opt.slidesToScroll = _.opt.slidesToShow;
}

_.itemWidth = _.containerWidth / _.opt.slidesToShow;
Expand Down
4 changes: 3 additions & 1 deletion docs/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -832,9 +832,11 @@ <h2>Settings</h2>
</li>
<li>
<span class="setting-name">slidesToScroll</span><br>
<span class="type">Type:</span> <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number">number</a><br>
<span class="type">Type:</span> <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number">number</a> | <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String">string</a><br>
<span class="type default">Default:</span> 1<br>
The number of slides to scroll when <b>arrow</b> navigation is used<br>

If this value is set to <code class="slim slimmer">auto</code>, it will match the value of `slidesToScroll`.
</li>
<li>
<span class="setting-name">itemWidth</span><br>
Expand Down
8 changes: 4 additions & 4 deletions glider.js
Original file line number Diff line number Diff line change
Expand Up @@ -88,10 +88,10 @@
if (!paging) paging = breakpointChanged;

if (_.opt.slidesToShow === 'auto'){
_.opt.slidesToShow = Math.floor(_.containerWidth / _.opt.itemWidth)
if (_.opt.slidesToScroll === 'auto'){
_.opt.slidesToScroll = _.opt.slidesToShow;
}
_.opt.slidesToShow = Math.floor(_.containerWidth / _.opt.itemWidth);
}
if (_.opt.slidesToScroll === 'auto'){
_.opt.slidesToScroll = _.opt.slidesToShow;
}

_.itemWidth = _.containerWidth / _.opt.slidesToShow;
Expand Down
4 changes: 2 additions & 2 deletions glider.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit df0a531

Please sign in to comment.