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();
});
});
});![Ensure your furry friend stays safe and entertained with our Dog Stake, Leash and Toy set. Our durable stake keeps your dog secure while the leash allows for controlled walks. The included toy provides mental and physical stimulation, promoting a healthy and happy pup.](//dragoyle.com/cdn/shop/files/1400048731063.jpg?v=1705795495&width=1445)
![Ensure your furry friend stays safe and entertained with our Dog Stake, Leash and Toy set. Our durable stake keeps your dog secure while the leash allows for controlled walks. The included toy provides mental and physical stimulation, promoting a healthy and happy pup.](http://dragoyle.com/cdn/shop/files/7347097283929.jpg?v=1705795487&width=1445)
![Ensure your furry friend stays safe and entertained with our Dog Stake, Leash and Toy set. Our durable stake keeps your dog secure while the leash allows for controlled walks. The included toy provides mental and physical stimulation, promoting a healthy and happy pup.](http://dragoyle.com/cdn/shop/files/1672288501533.jpg?v=1705795489&width=1445)
![Ensure your furry friend stays safe and entertained with our Dog Stake, Leash and Toy set. Our durable stake keeps your dog secure while the leash allows for controlled walks. The included toy provides mental and physical stimulation, promoting a healthy and happy pup.](http://dragoyle.com/cdn/shop/files/1454128110038.jpg?v=1705795491&width=1445)
![Ensure your furry friend stays safe and entertained with our Dog Stake, Leash and Toy set. Our durable stake keeps your dog secure while the leash allows for controlled walks. The included toy provides mental and physical stimulation, promoting a healthy and happy pup.](http://dragoyle.com/cdn/shop/files/1768339822583.jpg?v=1705795493&width=1445)
![Ensure your furry friend stays safe and entertained with our Dog Stake, Leash and Toy set. Our durable stake keeps your dog secure while the leash allows for controlled walks. The included toy provides mental and physical stimulation, promoting a healthy and happy pup.](http://dragoyle.com/cdn/shop/files/1400048731063.jpg?v=1705795495&width=1445)