1$(function(){ 2 $(window).on('resize', function(){ 3 if(lastScreenWidth > 0) 4 { 5 // if main carousel should switch view... 6 if((lastScreenWidth < 576 && window.innerWidth >= 576) || (lastScreenWidth >= 576 && window.innerWidth < 576)) 7 { 8 initMainBanner(); 9 } 10 } 11 12 lastScreenWidth = window.innerWidth; 13 }); 14 15 initMainBanner(); 16}); 17 18function initMainBanner() 19{ 20 if($('.mainbanner').length>0) 21 { 22 if($('.mainbanner .owl-carousel').hasClass('owl-loaded')) 23 { 24 $('.mainbanner .owl-carousel').owlCarousel('destroy'); 25 } 26 27 let size = window.innerWidth < 576 ? 'mobile' : 'desktop'; 28 29 $('.mainbanner .owl-carousel a').each(function(){ 30 let img = $(this).children('img'); 31 img.attr('src', null); 32 img.attr('data-src', $(this).data(size+'-image')); 33 img.attr('data-src-retina', $(this).data(size+'-image')); 34 }); 35 36 $('.owl-carousel').owlCarousel({ 37 loop:true, 38 items:1, 39 margin:10, 40 //nav:true, 41 lazyLoad: true, 42 lazyLoadEager: 1, 43 autoplay:true, 44 autoplayTimeout:3000, 45 autoplayHoverPause:true, 46 //animateOut: 'slideOutDown', 47 //animateIn: 'flipInX', 48 //smartSpeed:450, 49 dots:true, 50 }); 51 } 52}
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.