A space to discuss online store customization, theme development, and Liquid templating.
We're moving the community! Starting July 7, the current community will be read-only for approx. 2 weeks. You can browse content, but posting will be temporarily unavailable. Learn more
if (!this.elements.thumbnails || this.dataset.desktopLayout === 'stacked') {
activeMedia.scrollIntoView({behavior: 'smooth'});
}
Replace this with the following code or add two backslashes, "//", before each line to comment it out. This essentially turns these lines into comments that will not be used to affect your site. If done correctly, these lines will show up as a different color in the js code and the page will no longer shift upon clicking variant options.
//if (!this.elements.thumbnails || this.dataset.desktopLayout === 'stacked') {
// activeMedia.scrollIntoView({behavior: 'smooth'});
//}
Hi Omars-Spectacu,
It doesn't seem like you have a question - are you posting this as a suggested method for customising the behaviour of the product page, for other devs, or are you looking for info on this approach?
Liam | Developer Advocate @ Shopify
- Was my reply helpful? Click Like to let me know!
- Was your question answered? Mark it as an Accepted Solution
- To learn more visit Shopify.dev or the Shopify Web Design and Development Blog