From 633ab8f6a89777d488c9a7fbb9f2d32904ba9d84 Mon Sep 17 00:00:00 2001 From: Jarek Lipski Date: Sat, 29 May 2021 21:07:38 +0200 Subject: [PATCH] fix slider --- index.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/index.js b/index.js index 7b3eece..a06f1f5 100644 --- a/index.js +++ b/index.js @@ -98,7 +98,7 @@ function Slider ({ el } = {}) { // eslint-disable-line no-unused-vars } Webflow.push(() => { - const dots = document.querySelectorAll(`${this.el} .w-slider-dot`) + const dots = this.el.querySelectorAll('.w-slider-dot') this.slideCount = dots.length dots.forEach((dot, index) => { setObserver(dot, index) @@ -106,7 +106,7 @@ function Slider ({ el } = {}) { // eslint-disable-line no-unused-vars }) this.$watch('slide', (index) => { - const dot = document.querySelector(`${this.el} .w-slider-dot:nth-child(${index + 1})`) + const dot = this.el.querySelector(`.w-slider-dot:nth-child(${index + 1})`) if (dot && !dot.classList.contains('w-active')) { dot.dispatchEvent(new MouseEvent('click', { view: window, bubbles: true, cancelable: true })) }