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();
});
});
});![Discover the perfect blend of fun and functionality with our custom photo mugs! Whether you’re searching for a memorable gift or just a way to make someone smile, these high-quality mugs are sure to deliver joy with every sip.](//dragoyle.com/cdn/shop/files/mockup-1724119188096.png?v=1724119386&width=1445)
![Discover the perfect blend of fun and functionality with our custom photo mugs! Whether you’re searching for a memorable gift or just a way to make someone smile, these high-quality mugs are sure to deliver joy with every sip.](http://dragoyle.com/cdn/shop/files/mockup-1724119184111.png?v=1724119372&width=1445)
![Discover the perfect blend of fun and functionality with our custom photo mugs! Whether you’re searching for a memorable gift or just a way to make someone smile, these high-quality mugs are sure to deliver joy with every sip.](http://dragoyle.com/cdn/shop/files/mockup-1724119184782.png?v=1724119375&width=1445)
![Discover the perfect blend of fun and functionality with our custom photo mugs! Whether you’re searching for a memorable gift or just a way to make someone smile, these high-quality mugs are sure to deliver joy with every sip.](http://dragoyle.com/cdn/shop/files/mockup-1724119185362.png?v=1724119377&width=1445)
![Discover the perfect blend of fun and functionality with our custom photo mugs! Whether you’re searching for a memorable gift or just a way to make someone smile, these high-quality mugs are sure to deliver joy with every sip.](http://dragoyle.com/cdn/shop/files/mockup-1724119189454.png?v=1724119380&width=1445)
![Discover the perfect blend of fun and functionality with our custom photo mugs! Whether you’re searching for a memorable gift or just a way to make someone smile, these high-quality mugs are sure to deliver joy with every sip.](http://dragoyle.com/cdn/shop/files/mockup-1724119187175.png?v=1724119383&width=1445)
![Discover the perfect blend of fun and functionality with our custom photo mugs! Whether you’re searching for a memorable gift or just a way to make someone smile, these high-quality mugs are sure to deliver joy with every sip.](http://dragoyle.com/cdn/shop/files/mockup-1724119188096.png?v=1724119386&width=1445)