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 DIY marble racing maze ball track is one of my most favorite childhood toys. I enjoy this set with my grandson, we have hours of fun creating new designs and laughing with delight when the marbles race to the bottom. A fun enjoyable family activity.](//dragoyle.com/cdn/shop/products/4ECE625D88CC215DC54781ACE09F0D72.jpg?v=1663814408&width=1445)
![This DIY marble racing maze ball track is one of my most favorite childhood toys. I enjoy this set with my grandson, we have hours of fun creating new designs and laughing with delight when the marbles race to the bottom. A fun enjoyable family activity.](http://dragoyle.com/cdn/shop/products/341A3CFC932AA5CE535DE128FCF09A0A.jpg?v=1663814407&width=1445)
![This DIY marble racing maze ball track is one of my most favorite childhood toys. I enjoy this set with my grandson, we have hours of fun creating new designs and laughing with delight when the marbles race to the bottom. A fun enjoyable family activity.](http://dragoyle.com/cdn/shop/products/900E6969EA7AF77189096F5A295B8C30.jpg?v=1663814402&width=1445)
![This DIY marble racing maze ball track is one of my most favorite childhood toys. I enjoy this set with my grandson, we have hours of fun creating new designs and laughing with delight when the marbles race to the bottom. A fun enjoyable family activity.](http://dragoyle.com/cdn/shop/products/EFFDC708EF0E5C133C5A2B0B2050DD69.jpg?v=1663814410&width=1445)
![This DIY marble racing maze ball track is one of my most favorite childhood toys. I enjoy this set with my grandson, we have hours of fun creating new designs and laughing with delight when the marbles race to the bottom. A fun enjoyable family activity.](http://dragoyle.com/cdn/shop/products/E4BC9BC2995A0766BF4B4A22041EEDAA.jpg?v=1663814404&width=1445)
![This DIY marble racing maze ball track is one of my most favorite childhood toys. I enjoy this set with my grandson, we have hours of fun creating new designs and laughing with delight when the marbles race to the bottom. A fun enjoyable family activity.](http://dragoyle.com/cdn/shop/products/4B5BC0DBB8009A8EFE444D14192A0244.jpg?v=1663814405&width=1445)
![This DIY marble racing maze ball track is one of my most favorite childhood toys. I enjoy this set with my grandson, we have hours of fun creating new designs and laughing with delight when the marbles race to the bottom. A fun enjoyable family activity.](http://dragoyle.com/cdn/shop/products/4ECE625D88CC215DC54781ACE09F0D72.jpg?v=1663814408&width=1445)