Liquid, JavaScript, themes, sales channels
I added a custom slider to my .liquid and .css and made a change to my global.js (code below). Now my home page lands on the area where the custom slider once appeared - even though I have moved the slider to another position. Any idea why? Thanks!
Global.js Code Addition:
onButtonClick(event) {
event.preventDefault();
if(event.currentTarget.name === 'next') {
this.step++;
if(this.step > this.sliderItems.length - 1) {
this.step = 0
}
} else {
this.step--;
if(this.step < 0) {
this.step = this.sliderItems.length - 1
}
}
this.currentIndex(this.step);
}
linkToSlide(event) {
const dotIndex = event.currentTarget.dataset.dot;
this.step = dotIndex;
this.currentIndex(this.step);
}
currentIndex(index) {
this.update(index);
}
}
customElements.define('featured-slider-component', FeaturedSliderComponent);
Explore the 30-30-30 rule, a dynamic social media strategy for new businesses. Learn how t...
By Trevor Sep 20, 2023Discover how to leverage the often overlooked footer of your ecommerce site to gain custom...
By Skye Sep 15, 2023In this blog, we’ll be shining a light on Shopify Partners, Experts, and Affiliates. Who a...
By Imogen Sep 13, 2023