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();
});
});
});![Spook up your garden with this unique hand-painted Grim Reaper sculpture! With its bold and daring design, it will be sure to add an adventurous touch to your Halloween décor.](//dragoyle.com/cdn/shop/files/BD4AE6AE1198409F80CFBD56E7A3AA33.jpg?v=1696558357&width=1445)
![Spook up your garden with this unique hand-painted Grim Reaper sculpture! With its bold and daring design, it will be sure to add an adventurous touch to your Halloween décor.](http://dragoyle.com/cdn/shop/files/F9968DD57D3E6FF39A5DD8F5B4852A78.jpg?v=1696558359&width=1445)
![Spook up your garden with this unique hand-painted Grim Reaper sculpture! With its bold and daring design, it will be sure to add an adventurous touch to your Halloween décor.](http://dragoyle.com/cdn/shop/files/B0F7A1FBC835FD17117711C010A157A3.jpg?v=1696558350&width=1445)
![Spook up your garden with this unique hand-painted Grim Reaper sculpture! With its bold and daring design, it will be sure to add an adventurous touch to your Halloween décor.](http://dragoyle.com/cdn/shop/files/C766CADEBD94BAE4E203275996E94634.jpg?v=1696558353&width=1445)
![Spook up your garden with this unique hand-painted Grim Reaper sculpture! With its bold and daring design, it will be sure to add an adventurous touch to your Halloween décor.](http://dragoyle.com/cdn/shop/files/BF7EBB3F78BBB96661AC6478016C05B4.jpg?v=1696558675&width=1445)
![Spook up your garden with this unique hand-painted Grim Reaper sculpture! With its bold and daring design, it will be sure to add an adventurous touch to your Halloween décor.](http://dragoyle.com/cdn/shop/files/BD4AE6AE1198409F80CFBD56E7A3AA33.jpg?v=1696558357&width=1445)