diff --git a/src/scripts/Smooth.js b/src/scripts/Smooth.js index 1eba1ad9..32f872c7 100644 --- a/src/scripts/Smooth.js +++ b/src/scripts/Smooth.js @@ -707,7 +707,7 @@ export default class extends Core { addSections() { this.sections = {}; - let sections = this.el.querySelectorAll(`[data-${this.name}-section]`); + let sections = this.el.querySelectorAll(this.sectionSelector ? this.sectionSelector : `[data-${this.name}-section]`); if (sections.length === 0) { sections = [this.el]; } diff --git a/src/scripts/options.js b/src/scripts/options.js index c436165e..ac778efb 100644 --- a/src/scripts/options.js +++ b/src/scripts/options.js @@ -16,6 +16,7 @@ export const defaults = { draggingClass: 'has-scroll-dragging', smoothClass: 'has-scroll-smooth', initClass: 'has-scroll-init', + sectionSelector: null, getSpeed: false, getDirection: false, scrollFromAnywhere: false,