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();
});
});
});![Upgrade your incense game with our Purple Sand Dragon Backflow Incense Burner. This beautiful burner features a unique design that releases a downward flow of smoke, creating a mesmerizing and relaxing ambiance. Perfect for meditation, yoga, or simply unwinding after a long day.](//dragoyle.com/cdn/shop/files/6CF49D288FA2550990A31B3BB091B379.jpg?v=1708189707&width=1445)
![Upgrade your incense game with our Purple Sand Dragon Backflow Incense Burner. This beautiful burner features a unique design that releases a downward flow of smoke, creating a mesmerizing and relaxing ambiance. Perfect for meditation, yoga, or simply unwinding after a long day.](http://dragoyle.com/cdn/shop/files/1F78A6F36C1A2A320977A41DEBEF8D85.jpg?v=1708189709&width=1445)
![Upgrade your incense game with our Purple Sand Dragon Backflow Incense Burner. This beautiful burner features a unique design that releases a downward flow of smoke, creating a mesmerizing and relaxing ambiance. Perfect for meditation, yoga, or simply unwinding after a long day.](http://dragoyle.com/cdn/shop/files/A044024FC173A3576968DE9BA0B8C6EB.jpg?v=1708189698&width=1445)
![Upgrade your incense game with our Purple Sand Dragon Backflow Incense Burner. This beautiful burner features a unique design that releases a downward flow of smoke, creating a mesmerizing and relaxing ambiance. Perfect for meditation, yoga, or simply unwinding after a long day.](http://dragoyle.com/cdn/shop/files/6CF49D288FA2550990A31B3BB091B379.jpg?v=1708189707&width=1445)