// Use an IIFE (Immediately Invoked Function Expression) to avoid global scope pollution
(function() {
// Scope variables to the specific section to avoid conflicts with plentymarkets
const section = document.querySelector('.animalixs-category-section');
if (!section) return;
// Add smooth scroll indicator for mobile
const categoryScroll = section.querySelector('#categoryScroll');
const scrollHint = section.querySelector('#scrollHint');
if (!categoryScroll) return;
// Track scroll position for visual feedback
function checkScrollPosition() {
const scrollLeft = categoryScroll.scrollLeft;
const scrollWidth = categoryScroll.scrollWidth;
const clientWidth = categoryScroll.clientWidth;
// Show hint if there is more content to scroll to the right
// (adding a small 2px buffer for rounding errors)
if (scrollWidth - clientWidth - scrollLeft > 2 && scrollLeft < 20) {
if(scrollHint) scrollHint.classList.remove('hidden');
} else {
if(scrollHint) scrollHint.classList.add('hidden');
}
}
categoryScroll.addEventListener('scroll', checkScrollPosition);
// Also check on window resize
window.addEventListener('resize', checkScrollPosition);
// Mobile-specific: Add touch scroll hint for first load
window.addEventListener('load', function() {
checkScrollPosition(); // Check initially on load
// Removed the window.innerWidth <= 768 check so it animates on all devices
categoryScroll.style.animation = 'pulse-scroll 2s ease-in-out';
});
// Add keyboard navigation support (only when mouse is over the container)
section.addEventListener('mouseenter', function() {
document.addEventListener('keydown', handleKeydown);
});
section.addEventListener('mouseleave', function() {
document.removeEventListener('keydown', handleKeydown);
});
function handleKeydown(e) {
if (e.key === 'ArrowLeft') {
categoryScroll.scrollBy({ left: -100, behavior: 'smooth' });
} else if (e.key === 'ArrowRight') {
categoryScroll.scrollBy({ left: 100, behavior: 'smooth' });
}
}
// Dynamically inject the keyframes animation to ensure isolation
const styleId = 'animalixs-category-animations';
if (!document.getElementById(styleId)) {
const styleEl = document.createElement('style');
styleEl.id = styleId;
styleEl.textContent = `
@keyframes pulse-scroll {
0%, 100% { opacity: 1; }
50% { opacity: 0.7; }
}
`;
document.head.appendChild(styleEl);
}
})();
- Item bundle[Bundle] MEDITERRANEO Salt Lick 2x3kg – Organic Mediterranean Salt£11.60 *6 kilogram | £1.93 / kilogram* Incl. VAT excl. Shipping
- Item bundle[Bundle] MEDITERRANEO Salt Lick 4x3kg – Organic Mediterranean Sea Salt£24.00 *12 kilogram | £2.00 / kilogram* Incl. VAT excl. Shipping
- Chamomile Lolly-Lick 750g – Calming Sugar-Free Horse Toy£9.00 *750 gram | £12.00 / kilogram* Incl. VAT excl. Shipping
- Item bundle[Bundle] Chamomile Lolly-Lick 2x750g & Rope – Calming & Sugar-Free£17.00 *1500 gram | £11.33 / kilogram* Incl. VAT excl. Shipping
- Lolly-Lick Rosehip 750g – Sugar-Free Horse Vitamin Booster£9.00 *750 gram | £12.00 / kilogram* Incl. VAT excl. Shipping
- Item bundle[Bundle] Rosehip Lolly-Lick 2x750g & Rope – Sugar-Free Vitamin Boost£17.00 *1500 gram | £11.33 / kilogram* Incl. VAT excl. Shipping
- Lavender Lolly-Lick 750g – Calming Sugar-Free Horse Toy£9.00 *750 gram | £12.00 / kilogram* Incl. VAT excl. Shipping
- Item bundle[Bundle] Lavender Lolly-Lick 2x750g & Rope – Calming & Sugar-Free£17.00 *1500 gram | £11.33 / kilogram* Incl. VAT excl. Shipping
- Lolly-Lick Mint & Eucalyptus 750g – Natural Respiratory Aid£9.00 *750 gram | £12.00 / kilogram* Incl. VAT excl. Shipping
- Item bundle[Bundle] Mint Lolly-Lick 2x750g & Rope – Respiratory Support£17.00 *1500 gram | £11.33 / kilogram* Incl. VAT excl. Shipping
- Apple Lolly-Lick 750g – Sugar-Free Horse Boredom Relief£8.50 *750 gram | £11.33 / kilogram* Incl. VAT excl. Shipping
- Item bundle[Bundle] Apple Lolly-Lick Horse Set 2x750g – Sugar-Free Boredom Relief£16.00 *1500 gram | £10.67 / kilogram* Incl. VAT excl. Shipping
- Vanilla-Banana Lolly-Lick 750g – Sugar-Free Horse Toy£8.50 *750 gram | £11.33 / kilogram* Incl. VAT excl. Shipping
- Item bundle[Bundle] Vanilla-Banana Lolly-Lick 2x750g & Rope – Sugar-Free Horse Toy£16.00 *1500 gram | £10.67 / kilogram* Incl. VAT excl. Shipping
- New item[Bundle] Anti-Stress Plus Pig Lick 4x5kg – Reduces Stress & Aggression£95.00 *20000 gram | £4.75 / kilogram* Incl. VAT excl. Shipping
- New itemAnti-Stress Plus Pig Mineral Lick 5kg – Calming Magnesium£25.50 *5000 gram | £5.10 / kilogram* Incl. VAT excl. Shipping