Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <script>
- document.addEventListener('DOMContentLoaded', () => {
- const observerOptions = {
- root: null,
- rootMargin: '0px',
- threshold: 0.1
- };
- const fadeInElements = document.querySelectorAll('#home_products_archive_1 li, #home_categories_archive li');
- const observer = new IntersectionObserver((entries, observer) => {
- entries.forEach(entry => {
- if (entry.isIntersecting) {
- entry.target.classList.add('fade-in');
- observer.unobserve(entry.target);
- }
- });
- }, observerOptions);
- fadeInElements.forEach(element => {
- observer.observe(element);
- });
- });
- </script>
Advertisement
Add Comment
Please, Sign In to add comment