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();
});
});
});![e door to a whole new world of convenience for you and your furry friend with our Pet Home Access Screen Door! Say goodbye to constantly getting up to let your pet in and out. Enjoy the fresh air and sunlight while keeping your home secure. A must-have for any pet owner.](//dragoyle.com/cdn/shop/files/23789817D773F91C1643FB22745FDAC1.jpg?v=1720921808&width=1445)
![e door to a whole new world of convenience for you and your furry friend with our Pet Home Access Screen Door! Say goodbye to constantly getting up to let your pet in and out. Enjoy the fresh air and sunlight while keeping your home secure. A must-have for any pet owner.](http://dragoyle.com/cdn/shop/files/7A7C6D28E660A0A7CE8ACDA0D66B3E75.jpg?v=1720921812&width=1445)
![e door to a whole new world of convenience for you and your furry friend with our Pet Home Access Screen Door! Say goodbye to constantly getting up to let your pet in and out. Enjoy the fresh air and sunlight while keeping your home secure. A must-have for any pet owner.](http://dragoyle.com/cdn/shop/files/A99E0783B843DA885998745D541945E2.jpg?v=1720921797&width=1445)
![e door to a whole new world of convenience for you and your furry friend with our Pet Home Access Screen Door! Say goodbye to constantly getting up to let your pet in and out. Enjoy the fresh air and sunlight while keeping your home secure. A must-have for any pet owner.](http://dragoyle.com/cdn/shop/files/6394246D8995FDD20C3D2AB8197426A8.jpg?v=1720921799&width=1445)
![e door to a whole new world of convenience for you and your furry friend with our Pet Home Access Screen Door! Say goodbye to constantly getting up to let your pet in and out. Enjoy the fresh air and sunlight while keeping your home secure. A must-have for any pet owner.](http://dragoyle.com/cdn/shop/files/8F66043208D3007CC673C8D7FF9E5DA6.jpg?v=1720921802&width=1445)
![e door to a whole new world of convenience for you and your furry friend with our Pet Home Access Screen Door! Say goodbye to constantly getting up to let your pet in and out. Enjoy the fresh air and sunlight while keeping your home secure. A must-have for any pet owner.](http://dragoyle.com/cdn/shop/files/913FF4F5ED8C3E68BD939F193864DED3.jpg?v=1720921804&width=1445)
![e door to a whole new world of convenience for you and your furry friend with our Pet Home Access Screen Door! Say goodbye to constantly getting up to let your pet in and out. Enjoy the fresh air and sunlight while keeping your home secure. A must-have for any pet owner.](http://dragoyle.com/cdn/shop/files/092F31E29EF1EA67746D18C3D3493F42.jpg?v=1720921806&width=1445)
![e door to a whole new world of convenience for you and your furry friend with our Pet Home Access Screen Door! Say goodbye to constantly getting up to let your pet in and out. Enjoy the fresh air and sunlight while keeping your home secure. A must-have for any pet owner.](http://dragoyle.com/cdn/shop/files/23789817D773F91C1643FB22745FDAC1.jpg?v=1720921808&width=1445)