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();
});
});
});
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();
});
});
});![Unleash your inner green-thumb with this Mini 10 Pc Gardening Hand Tools Kit with Tote Bag! Planting, pruning, trimming, and watering are all a breeze with the help of this reliable set of handy tools.](//dragoyle.com/cdn/shop/products/1617779051888_1ce02672-3c0e-4167-b20c-cf9412203391.jpg?v=1709056981&width=1445)
![Unleash your inner green-thumb with this Mini 10 Pc Gardening Hand Tools Kit with Tote Bag! Planting, pruning, trimming, and watering are all a breeze with the help of this reliable set of handy tools.](http://dragoyle.com/cdn/shop/products/1617779051888.jpg?v=1709056970&width=1445)
![Unleash your inner green-thumb with this Mini 10 Pc Gardening Hand Tools Kit with Tote Bag! Planting, pruning, trimming, and watering are all a breeze with the help of this reliable set of handy tools.](http://dragoyle.com/cdn/shop/products/1617779051887.jpg?v=1658433994&width=1445)
![Unleash your inner green-thumb with this Mini 10 Pc Gardening Hand Tools Kit with Tote Bag! Planting, pruning, trimming, and watering are all a breeze with the help of this reliable set of handy tools.](http://dragoyle.com/cdn/shop/products/1617779051878.jpg?v=1658433994&width=1445)
![Unleash your inner green-thumb with this Mini 10 Pc Gardening Hand Tools Kit with Tote Bag! Planting, pruning, trimming, and watering are all a breeze with the help of this reliable set of handy tools.](http://dragoyle.com/cdn/shop/products/1617779051897.jpg?v=1658433994&width=1445)
![Unleash your inner green-thumb with this Mini 10 Pc Gardening Hand Tools Kit with Tote Bag! Planting, pruning, trimming, and watering are all a breeze with the help of this reliable set of handy tools.](http://dragoyle.com/cdn/shop/products/1621230465004.jpg?v=1658433994&width=1445)
![Unleash your inner green-thumb with this Mini 10 Pc Gardening Hand Tools Kit with Tote Bag! Planting, pruning, trimming, and watering are all a breeze with the help of this reliable set of handy tools.](http://dragoyle.com/cdn/shop/products/1617779051892.jpg?v=1709056973&width=1445)
![Unleash your inner green-thumb with this Mini 10 Pc Gardening Hand Tools Kit with Tote Bag! Planting, pruning, trimming, and watering are all a breeze with the help of this reliable set of handy tools.](http://dragoyle.com/cdn/shop/products/1617779051888_1ce02672-3c0e-4167-b20c-cf9412203391.jpg?v=1709056981&width=1445)