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();
});
});
});![For a thoughtful and cozy gift, our poly cotton photo pillows stand out as a heartfelt option for family, friends, or loved ones on any special occasion. These aren't just ordinary pillows; they blend the comfort of cotton with the personalized touch of a photo memory.](//dragoyle.com/cdn/shop/files/mockup-1720596925525.png?v=1720597299&width=1445)
![For a thoughtful and cozy gift, our poly cotton photo pillows stand out as a heartfelt option for family, friends, or loved ones on any special occasion. These aren't just ordinary pillows; they blend the comfort of cotton with the personalized touch of a photo memory.](http://dragoyle.com/cdn/shop/files/mockup-1720596923995.png?v=1720597294&width=1445)
![Your Personalized Photo Pillows](http://dragoyle.com/cdn/shop/files/Screenshot_2024-10-16_205548.jpg?v=1729133831&width=1445)
![Your Personalized Photo Pillows](http://dragoyle.com/cdn/shop/files/BabyTrinaPillow_151c87b5-fe9c-4261-b9cb-b95d4cd27b28.png?v=1729133651&width=1445)
![Your Personalized Photo Pillows](http://dragoyle.com/cdn/shop/files/Screenshot_2024-10-16_205645.jpg?v=1729133831&width=1445)
![For a thoughtful and cozy gift, our poly cotton photo pillows stand out as a heartfelt option for family, friends, or loved ones on any special occasion. These aren't just ordinary pillows; they blend the comfort of cotton with the personalized touch of a photo memory.](http://dragoyle.com/cdn/shop/files/mockup-1720596924785.png?v=1720597297&width=1445)
![For a thoughtful and cozy gift, our poly cotton photo pillows stand out as a heartfelt option for family, friends, or loved ones on any special occasion. These aren't just ordinary pillows; they blend the comfort of cotton with the personalized touch of a photo memory.](http://dragoyle.com/cdn/shop/files/mockup-1720596925525.png?v=1720597299&width=1445)