1var theWindow, bodyTag, htmlTag; 2var responsiveStyle, responsiveState, getResponsiveState, performResponsive, performResponsiveBase, delai; 3var mainWaypoints; 4 5(function($) { 6 // debounce function 7 function debounce(callback, delay){ 8 var timer; 9 return function(){ 10 var args = arguments; 11 var context = this; 12 clearTimeout(timer); 13 timer = setTimeout(function(){ 14 callback.apply(context, args); 15 }, delay) 16 } 17 } 18 19 // function used with specific stylesheet, to synch responsive state in JS with css 20 initResponsive = function() { 21 if (!$('#responsive-stylesheet').length) bodyTag.append('<div id="responsive-stylesheet"/>'); 22 responsiveStyle = $('#responsive-stylesheet'); 23 }; 24 25 // read real responsive state from css 26 getResponsiveState = function () { 27 responsiveState = responsiveStyle.css('zIndex'); 28 }; 29 30 // responsive actions to do on each resize 31 performResponsiveBase = function() { 32 getResponsiveState(); 33 if (responsiveState==1002) { 34 // -------------- medium screen 35 } else if (responsiveState==1003) { 36 // -------------- large screen 37 } else if (responsiveState==1004) { 38 // -------------- wide screen 39 } else { 40 // -------------- small screen 41 } 42 43 44 $('body:not(.category-6) .hero .backgrounded-video, body:not(.category-6) .hero .swiper, body:not(.category-6) .hero .inner-content>.media').each(function(el){ 45 if(responsiveState>1002) { 46 $(this).css('height', (Math.ceil(parseInt($(this).parent().css('height'))))+'px'); 47 } else { 48 $(this).css('height',''); 49 } 50 }); 51 $('img.padder').each(function(){ 52 var videoTag = $(this).nextAll('.video'); 53 videoTag.css('height', (parseInt($(this).css('height')) * 1.01) + 'px'); 54 videoTag.css('width', (parseInt($(this).css('width')) * 1.01) + 'px'); 55 videoTag.css('top',''); 56 57 if(videoTag.css('position')=='fixed') { 58 var deltaTop = parseFloat(videoTag.parent().css('height')) - parseInt(videoTag.css('height')); 59 deltaTop = deltaTop / 2 ; 60 videoTag.css('top', (deltaTop + 'px')); 61 } 62 }); 63 64 } 65 66 67 // responsive stuff to do once 68 performResponsive=function() { 69 performResponsiveBase(); 70 } 71 72 // on dom ready 73 $(document).ready(function () { 74 bodyTag = $('body'); 75 theWindow = $(window); 76 htmlTag = $('html'); 77 delai = 250; 78 79 // js ready 80 bodyTag.addClass('js'); 81 82 // prepare responsive gymm 83 initResponsive(); 84 85 // watch responsive 86 theWindow.bind('resize orientationchange', debounce(function(e){ 87 performResponsiveBase(); 88 },delai)); 89 performResponsive(); 90 }); 91})(jQuery);
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.