document.addEventListener('DOMContentLoaded', function () {
// Get the product images container
var productMedia = document.querySelectorAll('.product-single__media-item');
// Get the variant dropdown or buttons
var variantSelectors = document.querySelectorAll('[name="id"]');
// Function to display the first product image
function showFirstImage() {
if (productMedia.length > 0) {
productMedia.forEach(function (media, index) {
if (index === 0) {
media.style.display = 'block';
} else {
media.style.display = 'none';
}
});
}
}
// Show the first image on page load
showFirstImage();
// Add event listeners to variant selectors
variantSelectors.forEach(function (selector) {
selector.addEventListener('change', function () {
showFirstImage();
});
});
});
document.addEventListener('DOMContentLoaded', function () {
// Get the product images container
var productMedia = document.querySelectorAll('.product-single__media-item');
// Get the variant dropdown or buttons
var variantSelectors = document.querySelectorAll('[name="id"]');
// Function to display the first product image
function showFirstImage() {
if (productMedia.length > 0) {
productMedia.forEach(function (media, index) {
if (index === 0) {
media.style.display = 'block';
} else {
media.style.display = 'none';
}
});
}
}
// Show the first image on page load
showFirstImage();
// Add event listeners to variant selectors
variantSelectors.forEach(function (selector) {
selector.addEventListener('change', function () {
showFirstImage();
});
});
});
document.addEventListener('DOMContentLoaded', function () {
// Get the product images container
var productMedia = document.querySelectorAll('.product-single__media-item');
// Get the variant dropdown or buttons
var variantSelectors = document.querySelectorAll('[name="id"]');
// Function to display the first product image
function showFirstImage() {
if (productMedia.length > 0) {
productMedia.forEach(function (media, index) {
if (index === 0) {
media.style.display = 'block';
} else {
media.style.display = 'none';
}
});
}
}
// Show the first image on page load
showFirstImage();
// Add event listeners to variant selectors
variantSelectors.forEach(function (selector) {
selector.addEventListener('change', function () {
showFirstImage();
});
});
});
document.addEventListener('DOMContentLoaded', function () {
// Get the product images container
var productMedia = document.querySelectorAll('.product-single__media-item');
// Get the variant dropdown or buttons
var variantSelectors = document.querySelectorAll('[name="id"]');
// Function to display the first product image
function showFirstImage() {
if (productMedia.length > 0) {
productMedia.forEach(function (media, index) {
if (index === 0) {
media.style.display = 'block';
} else {
media.style.display = 'none';
}
});
}
}
// Show the first image on page load
showFirstImage();
// Add event listeners to variant selectors
variantSelectors.forEach(function (selector) {
selector.addEventListener('change', function () {
showFirstImage();
});
});
});
document.addEventListener('DOMContentLoaded', function () {
// Get the product images container
var productMedia = document.querySelectorAll('.product-single__media-item');
// Get the variant dropdown or buttons
var variantSelectors = document.querySelectorAll('[name="id"]');
// Function to display the first product image
function showFirstImage() {
if (productMedia.length > 0) {
productMedia.forEach(function (media, index) {
if (index === 0) {
media.style.display = 'block';
} else {
media.style.display = 'none';
}
});
}
}
// Show the first image on page load
showFirstImage();
// Add event listeners to variant selectors
variantSelectors.forEach(function (selector) {
selector.addEventListener('change', function () {
showFirstImage();
});
});
});
document.addEventListener('DOMContentLoaded', function () {
// Get the product images container
var productMedia = document.querySelectorAll('.product-single__media-item');
// Get the variant dropdown or buttons
var variantSelectors = document.querySelectorAll('[name="id"]');
// Function to display the first product image
function showFirstImage() {
if (productMedia.length > 0) {
productMedia.forEach(function (media, index) {
if (index === 0) {
media.style.display = 'block';
} else {
media.style.display = 'none';
}
});
}
}
// Show the first image on page load
showFirstImage();
// Add event listeners to variant selectors
variantSelectors.forEach(function (selector) {
selector.addEventListener('change', function () {
showFirstImage();
});
});
});![This 3-piece set of cookware is the perfect companion when you're cooking on the go! With aluminum oxide construction and a lightweight design, you can enjoy durable cooking convenience no matter where you are.](//dragoyle.com/cdn/shop/files/91D1293BA487073F54CB746B77B29E30.jpg?v=1699349624&width=1445)
![This 3-piece set of cookware is the perfect companion when you're cooking on the go! With aluminum oxide construction and a lightweight design, you can enjoy durable cooking convenience no matter where you are.](http://dragoyle.com/cdn/shop/files/FD58F7388FC3DD5FA4DB9AAB153568B9.jpg?v=1699349613&width=1445)
![This 3-piece set of cookware is the perfect companion when you're cooking on the go! With aluminum oxide construction and a lightweight design, you can enjoy durable cooking convenience no matter where you are.](http://dragoyle.com/cdn/shop/files/F56A2ED60E4509EAA492F971D0FE2488.jpg?v=1699349616&width=1445)
![This 3-piece set of cookware is the perfect companion when you're cooking on the go! With aluminum oxide construction and a lightweight design, you can enjoy durable cooking convenience no matter where you are.](http://dragoyle.com/cdn/shop/files/5D17E822DE199A45F616DA5ACBD1E672.jpg?v=1699349618&width=1445)
![This 3-piece set of cookware is the perfect companion when you're cooking on the go! With aluminum oxide construction and a lightweight design, you can enjoy durable cooking convenience no matter where you are.](http://dragoyle.com/cdn/shop/files/CB4A32C3A6298BC1F3A5DB01FB346D83.jpg?v=1699349620&width=1445)
![This 3-piece set of cookware is the perfect companion when you're cooking on the go! With aluminum oxide construction and a lightweight design, you can enjoy durable cooking convenience no matter where you are.](http://dragoyle.com/cdn/shop/files/14EB96131FB34CF2CB41E1267D27235E.jpg?v=1699349622&width=1445)
![This 3-piece set of cookware is the perfect companion when you're cooking on the go! With aluminum oxide construction and a lightweight design, you can enjoy durable cooking convenience no matter where you are.](http://dragoyle.com/cdn/shop/files/91D1293BA487073F54CB746B77B29E30.jpg?v=1699349624&width=1445)