test
parent
e37450eaab
commit
70323723c3
|
@ -1050,9 +1050,15 @@ class VariantSelects extends HTMLElement {
|
|||
document.querySelectorAll('[thumbnail-alt-mobile]').forEach((thumbnail) => {
|
||||
console.log(thumbnail.getAttribute('thumbnail-alt-mobile'));
|
||||
if (thumbnail.getAttribute('thumbnail-alt-mobile') === this.currentVariant.featured_image.alt) {
|
||||
thumbnail.style.display = 'block';
|
||||
// check if has class "is-active" to show the image
|
||||
if (thumbnail.classList.contains('is-active') === false) {
|
||||
thumbnail.classList.add('is-active');
|
||||
}
|
||||
} else {
|
||||
thumbnail.style.display = 'none';
|
||||
// check if has class "is-active" to hide the image
|
||||
if (thumbnail.classList.contains('is-active') === true) {
|
||||
thumbnail.classList.remove('is-active');
|
||||
}
|
||||
}
|
||||
}
|
||||
);
|
||||
|
|
Loading…
Reference in New Issue