// 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);
}
})();
Artikelbewertung
Anwendungsbereich
- VitaminPlus Selen, Mineralleckstein, 3kg10,71 £ *3 Kilogramm | 3,57 £ / Kilogramm* inkl. ges. MwSt. zzgl. Versandkosten
- Artikelpaket[Paket] VitaminPlus Selen, Mineralleckstein, Set mit 2x 3kg19,71 £ *6 Kilogramm | 3,28 £ / Kilogramm* inkl. ges. MwSt. zzgl. Versandkosten
- Artikelpaket[Paket] VitaminPlus Selen, Mineralleckstein, Set mit 4x 3kg41,13 £ *12 Kilogramm | 3,43 £ / Kilogramm* inkl. ges. MwSt. zzgl. Versandkosten
- PROBIOTIC Mineralleckstein, 3kg14,99 £ *3 Kilogramm | 5,00 £ / Kilogramm* inkl. ges. MwSt. zzgl. Versandkosten
- Artikelpaket[Paket] PROBIOTIC 2er Set Mineralleckstein, 2x 3kg29,99 £ *6 Kilogramm | 5,00 £ / Kilogramm* inkl. ges. MwSt. zzgl. Versandkosten
- Artikelpaket[Paket] PROBIOTIC 4er Set Mineralleckstein, 4x 3kg58,26 £ *12 Kilogramm | 4,86 £ / Kilogramm* inkl. ges. MwSt. zzgl. Versandkosten
- Top-ArtikelANTI-INSECT Mineralleckstein, 3kg13,71 £ *3 Kilogramm | 4,57 £ / Kilogramm* inkl. ges. MwSt. zzgl. Versandkosten
- Top-Artikel[Paket] ANTI-INSECT Mineralleckstein, Set mit 4x 3kg53,12 £ *12 Kilogramm | 4,43 £ / Kilogramm* inkl. ges. MwSt. zzgl. Versandkosten
- EquiVital PLUS Mineralleckstein, 3kg12,85 £ *3 Kilogramm | 4,28 £ / Kilogramm* inkl. ges. MwSt. zzgl. Versandkosten
- Artikelpaket[Paket] EquiVital PLUS 2er Set Mineralleckstein, 2x 3kg24,85 £ *6 Kilogramm | 4,14 £ / Kilogramm* inkl. ges. MwSt. zzgl. Versandkosten
- Artikelpaket[Paket] EquiVital PLUS 4er Set Mineralleckstein, 4x 3kg49,69 £ *12 Kilogramm | 4,14 £ / Kilogramm* inkl. ges. MwSt. zzgl. Versandkosten
- MultiVitamin BRONCHIAL Mineralleckstein, 3kg10,71 £ *3 Kilogramm | 3,57 £ / Kilogramm* inkl. ges. MwSt. zzgl. Versandkosten
- Top-Artikel[Paket] MultiVitamin BRONCHIAL 4er Set, Mineralleckstein, 4x 3kg41,13 £ *12 Kilogramm | 3,43 £ / Kilogramm* inkl. ges. MwSt. zzgl. Versandkosten
- ENERGOBLOCK Mineralleckstein, 3kg11,57 £ *3 Kilogramm | 3,86 £ / Kilogramm* inkl. ges. MwSt. zzgl. Versandkosten
- Artikelpaket[Paket] ENERGOBLOCK 2er Set Mineralleckstein, 2x 3kg20,56 £ *6 Kilogramm | 3,43 £ / Kilogramm* inkl. ges. MwSt. zzgl. Versandkosten
- Artikelpaket[Paket] ENERGOBLOCK 4er Set Mineralleckstein, 4x 3kg44,55 £ *12 Kilogramm | 3,71 £ / Kilogramm* inkl. ges. MwSt. zzgl. Versandkosten
- PREMIUMBLOCK Mineralleckstein, 3kg6,43 £ *3 Kilogramm | 2,14 £ / Kilogramm* inkl. ges. MwSt. zzgl. Versandkosten
- Artikelpaket[Paket] PREMIUMBLOCK 2er Set Mineralleckstein, 2x 3kg11,82 £ *6 Kilogramm | 1,97 £ / Kilogramm* inkl. ges. MwSt. zzgl. Versandkosten
- Artikelpaket[Paket] PREMIUMBLOCK 4er Set Mineralleckstein, 4x 3kg23,99 £ *12 Kilogramm | 2,00 £ / Kilogramm* inkl. ges. MwSt. zzgl. Versandkosten
- MEDITERRANEO Salzleckstein, 3kg5,57 £ *3 Kilogramm | 1,86 £ / Kilogramm* inkl. ges. MwSt. zzgl. Versandkosten