Our Partner & Developer boards on the community are moving to a brand new home: the .dev community forums! While you can still access past discussions here, for all your future app and storefront building questions, head over to the new forums.

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

this.dataset.desktopLayout

this.dataset.desktopLayout

omars-Spectacu
Shopify Partner
3 0 0

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'});

//}

Reply 1 (1)

Liam
Community Manager
3108 344 910

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