mirror of
https://github.com/webslides/WebSlides.git
synced 2025-08-28 23:41:48 +02:00
@@ -36,6 +36,7 @@ export default class WebSlides {
|
|||||||
* @param {boolean} loop Whether to go to first slide from last one or not.
|
* @param {boolean} loop Whether to go to first slide from last one or not.
|
||||||
* @param {number} minWheelDelta Controls the amount of needed scroll to
|
* @param {number} minWheelDelta Controls the amount of needed scroll to
|
||||||
* trigger navigation.
|
* trigger navigation.
|
||||||
|
* @param {boolean} navigateOnScroll Whether scroll can trigger navigation or not.
|
||||||
* @param {number} scrollWait Controls the amount of time to wait till
|
* @param {number} scrollWait Controls the amount of time to wait till
|
||||||
* navigation can occur again with scroll.
|
* navigation can occur again with scroll.
|
||||||
* @param {number} slideOffset Controls the amount of needed touch delta to
|
* @param {number} slideOffset Controls the amount of needed touch delta to
|
||||||
@@ -46,6 +47,7 @@ export default class WebSlides {
|
|||||||
changeOnClick = false,
|
changeOnClick = false,
|
||||||
loop = true,
|
loop = true,
|
||||||
minWheelDelta = 40,
|
minWheelDelta = 40,
|
||||||
|
navigateOnScroll = true,
|
||||||
scrollWait = 450,
|
scrollWait = 450,
|
||||||
slideOffset = 50
|
slideOffset = 50
|
||||||
} = {}) {
|
} = {}) {
|
||||||
|
@@ -40,6 +40,11 @@ export default class Scroll {
|
|||||||
*/
|
*/
|
||||||
this.timeout_ = null;
|
this.timeout_ = null;
|
||||||
|
|
||||||
|
// Disabling from option
|
||||||
|
if (!this.ws_.options.navigateOnScroll) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (!MobileDetector.isAny()) {
|
if (!MobileDetector.isAny()) {
|
||||||
this.scrollContainer_.addEventListener(
|
this.scrollContainer_.addEventListener(
|
||||||
'wheel', this.onMouseWheel_.bind(this));
|
'wheel', this.onMouseWheel_.bind(this));
|
||||||
|
Reference in New Issue
Block a user