1function waitForElementVisibleOnce(elementSelector, threshold, callback) { 2 let isVisible = false; 3 4 const observer = new IntersectionObserver((entries) => { 5 if (entries[0].isIntersecting && entries[0].intersectionRatio >= threshold && !isVisible) { 6 isVisible = true; 7 8 observer.unobserve(element); 9 callback(); 10 } 11 }, { threshold }); 12 13 observer.observe(element); 14 } 15 16 let currentSlide = 1; 17 18 function cycleVisibility() { 19 currentSlide++; 20 21 if (currentSlide > 4) { 22 currentSlide = 1; 23 } 24 25 // Fade out current elements 26 jQuery('.cusocal-carousel-img').css('display', 'none'); 27 jQuery('.cusocal-carousel-title').css('display', 'none'); 28 jQuery('.cusocal-image-carousel-link').css('text-decoration', 'none'); 29 jQuery('.cusocal-image-carousel-link').css('color', '#000000'); 30 31 // Fade in next slide 32 jQuery('.cusocal-carousel-img-' + currentSlide).fadeIn(500); 33 jQuery('.cusocal-carousel-title-' + currentSlide).fadeIn(500); 34 jQuery('.cusocal-image-carousel-link-' + currentSlide).css('text-decoration', 'underline'); 35 jQuery('.cusocal-image-carousel-link-' + currentSlide).css('color', '#034063'); 36 37 if (window.innerWidth <= 768) { 38 if(currentSlide == 1){ 39 jQuery('.mobile-image-carousel-links').html('<p class="mobile-image-carousel-link">The CU SoCal team participates in charitable efforts throughout the year.</p>'); 40 }else if(currentSlide == 2){ 41 jQuery('.mobile-image-carousel-links').html('<p class="mobile-image-carousel-link">These projects help build community and camaraderie.</p>'); 42 }else if(currentSlide == 3){ 43 jQuery('.mobile-image-carousel-links').html('<p class="mobile-image-carousel-link">We deliver these community efforts at various venues throughout the year, including non-profits, local businesses, and schools.</p>'); 44 }else if(currentSlide == 4){ 45 jQuery('.mobile-image-carousel-links').html('<p class="mobile-image-carousel-link">That community commitment stays with us every day, especially when we donate to local organizations.</p>'); 46 } 47 } 48 } 49 50 // Start cycle after DOM is ready 51 document.addEventListener('DOMContentLoaded', function() { 52 // cycleVisibility(); 53 setInterval(cycleVisibility, 5000); // Fires every 6 seconds 54 });
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.