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();
});
});
});![Bring joy and beauty to your backyard with our Solar Hanging Sunflower Bird Feeder! The stunning design of sunflower petals and the solar-powered LED light will attract birds while providing sustainable energy. Enjoy the peaceful sound of singing birds and help the environment at the same time!](//dragoyle.com/cdn/shop/files/E3C7C006E0A85D2D1D0EE6E6D41BDE4E.jpg?v=1733107635&width=1445)
![Bring joy and beauty to your backyard with our Solar Hanging Sunflower Bird Feeder! The stunning design of sunflower petals and the solar-powered LED light will attract birds while providing sustainable energy. Enjoy the peaceful sound of singing birds and help the environment at the same time!](http://dragoyle.com/cdn/shop/files/227A4A4CB73F773B7CD1E100BBF67B23.jpg?v=1733107630&width=1445)
![Bring joy and beauty to your backyard with our Solar Hanging Sunflower Bird Feeder! The stunning design of sunflower petals and the solar-powered LED light will attract birds while providing sustainable energy. Enjoy the peaceful sound of singing birds and help the environment at the same time!](http://dragoyle.com/cdn/shop/files/A83AE992B9C87869AD69C58F617B7417.jpg?v=1733107626&width=1445)
![Bring joy and beauty to your backyard with our Solar Hanging Sunflower Bird Feeder! The stunning design of sunflower petals and the solar-powered LED light will attract birds while providing sustainable energy. Enjoy the peaceful sound of singing birds and help the environment at the same time!](http://dragoyle.com/cdn/shop/files/D40B16941733A83FFBA4BF72A4ACC70B.jpg?v=1733107628&width=1445)
![Bring joy and beauty to your backyard with our Solar Hanging Sunflower Bird Feeder! The stunning design of sunflower petals and the solar-powered LED light will attract birds while providing sustainable energy. Enjoy the peaceful sound of singing birds and help the environment at the same time!](http://dragoyle.com/cdn/shop/files/334E300B47E48B9B0082450B8A2398C9.jpg?v=1733107631&width=1445)
![Bring joy and beauty to your backyard with our Solar Hanging Sunflower Bird Feeder! The stunning design of sunflower petals and the solar-powered LED light will attract birds while providing sustainable energy. Enjoy the peaceful sound of singing birds and help the environment at the same time!](http://dragoyle.com/cdn/shop/files/00D0AEB6EE96BA0DA7B93F22737540D3.jpg?v=1733107633&width=1445)
![Bring joy and beauty to your backyard with our Solar Hanging Sunflower Bird Feeder! The stunning design of sunflower petals and the solar-powered LED light will attract birds while providing sustainable energy. Enjoy the peaceful sound of singing birds and help the environment at the same time!](http://dragoyle.com/cdn/shop/files/E3C7C006E0A85D2D1D0EE6E6D41BDE4E.jpg?v=1733107635&width=1445)