v2.5.0 — Multiple slides possible
This release allows having slides that are smaller than the slider itself.
Feature: Sizing method
By default, the first slide's offsetWidth
is used to calculate everything. Override this method to change the slider's behavior.
/**
* @callback sizingMethod
* @param {ScrollSnapSlider} slider
* @return {Number} integer size of a slide in pixels
*/
/**
* Width of each slide
* @type {sizingMethod}
* @public
*/
this.sizingMethod = function (slider) {
return slider.element.firstElementChild.offsetWidth
}