1(function(){ 2 var carousel, inner, items, resizeT; 3 function syncHeight() { 4 if (!inner || !carousel) return; 5 if (window.innerWidth > 360) { 6 inner.style.height = ''; 7 carousel.style.height = ''; 8 return; 9 } 10 var maxH = 0, i, el; 11 for (i = 0; i < items.length; i++) { 12 el = items[i]; 13 if (el.offsetHeight > maxH) maxH = el.offsetHeight; 14 } 15 inner.style.height = maxH + 'px'; 16 carousel.style.height = maxH + 'px'; 17 } 18 function onResize() { 19 clearTimeout(resizeT); 20 resizeT = setTimeout(syncHeight, 80); 21 } 22 function init() { 23 carousel = document.getElementById('ldCarousel'); 24 if (!carousel) return; 25 inner = carousel.querySelector('.carousel-inner'); 26 items = carousel.querySelectorAll('.item'); 27 if (!inner || !items.length) return; 28 syncHeight(); 29 if (typeof jQuery !== 'undefined') { 30 jQuery(carousel).on('slid.bs.carousel', syncHeight); 31 } 32 window.addEventListener('resize', onResize); 33 window.addEventListener('load', syncHeight); 34 } 35 if (document.readyState === 'loading') { 36 document.addEventListener('DOMContentLoaded', init); 37 } else { 38 init(); 39 } 40})();
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.