<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.7.0/jquery.min.js"></script> <script> $(document).ready(() => { const target1 = document.getElementById('block-yui_3_17_2_1_1724327598782_8208'); const target2 = document.getElementById('block-yui_3_17_2_1_1724329738826_22440'); const target3 = document.getElementById('block-yui_3_17_2_1_1724329738826_2192'); const target4 = document.getElementById('block-yui_3_17_2_1_1725000355377_14534'); // Create an IntersectionObserver instance const observer = new IntersectionObserver((entries) => { entries.forEach(entry => { if (entry.isIntersecting) { console.log('Element is in the viewport!'); const el = document.getElementById(entry.target.id) el.classList.add('scrollto') // Add your code here to handle when the element is visible } }); }, { threshold: 0.5 }); // Adjust the threshold as needed // Start observing the target element observer.observe(target1); observer.observe(target2); observer.observe(target3); observer.observe(target4); }) </script>