1/************************** 2 Control the Banner size 3**************************/ 4function homeBannerSize() { 5 headerHeight = $('#header').height(); 6 bannerHeight = $(window).height() - headerHeight; 7 $('.banner').css('height', bannerHeight); 8} 9 10$(document).ready(function() { 11 homeBannerSize(); 12 var w = $(window).width(); 13 $(window).resize(function() { 14 if ($(window).width()==w && !$('body').hasClass('desktop')) return; 15 w = $(window).width(); 16 homeBannerSize(); 17 }); 18}); 19 20 21/************************** 22 Main Banner 23**************************/ 24$(document).ready(function() { 25 $('#hero-banner').slick({ 26 fade: true, 27 infinite: true, 28 autoplay: true, 29 autoplaySpeed: 8000, 30 slidesToShow: 1, 31 pauseOnHover: false, 32 draggable: false, 33 arrows: false, 34 dots: false, 35 useCSS: false, 36 useTransform: false, 37 responsive: [ 38 { 39 breakpoint: 771, 40 settings: { 41 draggable: true, 42 } 43 } 44 ] 45 }); 46}); 47 48/************************** 49 Countdown 50**************************/ 51function addZeros(n, needLength) { 52 needLength = needLength || 2; 53 n = String(n); 54 while (n.length < needLength) { 55 n = "0" + n; 56 } 57 return n; 58} 59 60function countdown(date = false) { 61 // Set the date we're counting down to 62 var countDownDate = new Date(date).getTime(); 63 // Update the count down every 1 second 64 var x = setInterval(function() { 65 // Get today's date and time 66 var now = new Date().getTime(); 67 // Find the distance between now and the count down date 68 var distance = countDownDate - now; 69 // Time calculations for days, hours, minutes and seconds 70 var days = Math.floor(distance / (1000 * 60 * 60 * 24)); 71 var hours = Math.floor((distance % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60)); 72 var minutes = Math.floor((distance % (1000 * 60 * 60)) / (1000 * 60)); 73 var seconds = Math.floor((distance % (1000 * 60)) / 1000); 74 // Set date format 75 days = addZeros(days, 3); 76 hours = addZeros(hours, 2); 77 minutes = addZeros(minutes, 2); 78 seconds = addZeros(seconds, 2); 79 // Set template view 80 var wrap = document.getElementById("counter"); 81 var template = '<div>Days <span>' + days + '</span></div>' + 82 '<div>Hours <span>' + hours + '</span></div>' + 83 '<div>Minutes <span>' + minutes + '</span></div>' + 84 '<div>Seconds <span>' + seconds + '</span></div>'; 85// console.log(distance); 86 // If the count down is over 87 if (distance < 0) { 88 clearInterval(x); 89 template = '<div>Days <span>000</span></div>' + 90 '<div>Hours <span>00</span></div>' + 91 '<div>Minutes <span>00</span></div>' + 92 '<div>Seconds <span>00</span></div>'; 93 } 94 wrap.innerHTML = template; 95 if (distance < 0) { 96 clearTimer = setTimeout(function() { $('#counter').fadeOut(800, function() { $(this).remove() }); clearTimeout(clearTimer); }, 1000); 97 } 98 }, 1000); 99} 100 101 102/**************************** 103 Content Toggle 104****************************/ 105function contentToggle() { 106 $('.toggle-list .toggle-box:first-child').addClass('toggle-open'); 107 $('.toggle-list .toggle-box:first-child .toggle-content').slideDown(); 108 $('.toggle-head').each(function() { 109 var nextContent = $(this).next('.toggle-content'); 110 $(this).on('click', function() { 111 $('.toggle-head').not(this).parent('div').removeClass('toggle-open'); 112 $(this).parent('div').toggleClass('toggle-open'); 113 $(nextContent).slideToggle(300); 114 $('.toggle-content').not($(nextContent)).slideUp(); 115 }); 116 }); 117} 118 119$(document).ready(function() { 120 contentToggle(); 121}); 122 123
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.