1(function ($) { 2 "use strict"; 3 4 var mobile; 5 6 function enq() { 7 enquire.register("screen and (min-width: 50em)", { 8 match: function () { 9 mobile = false; 10 }, 11 unmatch: function () { 12 mobile = true; 13 }, 14 setup: function () { 15 mobile = true; 16 } 17 }); 18 } 19 20 function waitForElementDisplay(elementPath, callBack){ 21 window.setTimeout(function(){ 22 if($(elementPath).width() > 0 ){ 23 callBack(elementPath, $(elementPath)); 24 }else{ 25 waitForElementDisplay(elementPath, callBack); 26 } 27 },500) 28 } 29 if ($('.header-mailing-list').children().length > 0) { 30 waitForElementDisplay(".header-mailing-list",function(){ 31 $('#slide-menu-gr').css('opacity', '1'); 32 $('#slide-menu-gr-social').css('opacity', '1'); 33 $('#slide-menu-gr-social-dropdown').css('opacity', '1'); 34 }); 35 } 36 37 //Initialise page elements on load 38 function init() { 39 // calculate the height of the promo home section so that it can covered correctly by background image 40 var windowHeight = $(window).height(); 41 var headerHeight = $('.site-header').outerHeight() ? $('.site-header').outerHeight() : 0; 42 var mobileFooterHeight = $('#docked-menu-gr').outerHeight() ? $('#docked-menu-gr').outerHeight() : 0; 43 var bannerContentAvailable = ($('#page').hasClass('noSlides') ? false : true); 44 if (( 45 umggr_multipage_home_vars.home_header_type == 'static-image' 46 && umggr_multipage_home_vars.home_header_image == 'crop' 47 ) || umggr_multipage_home_vars.home_header_image === 'slickslider') { 48 49 if (!mobile) { 50 if (bannerContentAvailable) { 51 $('.promo.home').height(windowHeight - headerHeight); 52 $('.promo.home[data-headerType=slickslider] .slider-gr .slider-gr-container').height(windowHeight - (headerHeight + mobileFooterHeight)); 53 } 54 } else { 55 if (bannerContentAvailable) { 56 $('.promo.home').height(windowHeight - (headerHeight + mobileFooterHeight)); 57 $('.promo.home[data-headerType=slickslider] .slider-gr').height(windowHeight - (headerHeight + mobileFooterHeight)); 58 $('.promo.home[data-headerType=slickslider] .slider-gr .slider-gr-container').height(windowHeight - (headerHeight + mobileFooterHeight)); 59 $('.promo.home[data-headerType=slickslider] .slider-gr .slider-gr-container .slick-list').height(windowHeight - (headerHeight + mobileFooterHeight)); 60 $('#home .slider-gr.wide-slide .slider-gr-slide .slide-image .slide-image-background').height(windowHeight - (headerHeight + mobileFooterHeight)); 61 } 62 } 63 } 64 65if ($('.slider-gr .promo-slider').length) { 66 67 var stdPromoSliderSettings = { 68 69 } 70 } 71 if ($('.slider-gr .promo-slider').length) { 72 73 var stdPromoSliderSettings = { 74 slidesToShow: 1, 75 slidesToScroll: 1, 76 infinite: true, 77 dots: umggr_multipage_home_vars.banner_navigation == 'dots' || umggr_multipage_home_vars.banner_navigation == 'both', 78 arrows: umggr_multipage_home_vars.banner_navigation == 'arrows' || umggr_multipage_home_vars.banner_navigation == 'both', 79 draggable: true, 80 prevArrow: '<span class="slick-prev"></span>', 81 nextArrow: '<span class="slick-next"></span>' 82 } 83 84 if (typeof window.UMGGR_Promo_Slick_Slider_Option != "undefined") { // 85 var mergedPromoSliderSettings = {...stdPromoSliderSettings, ...window.UMGGR_Promo_Slick_Slider_Option}; 86 } else { 87 var mergedPromoSliderSettings = stdPromoSliderSettings; 88 } 89 90 $('.promo-slider').not('.slick-initialized').slick(mergedPromoSliderSettings); 91 92 // show / hide the mobile version of the slider images 93 if ($(window).width() > 800) { 94 $(".slide-mobile").css('display', 'none'); 95 } else { 96 $(".slide-mobile").css('display', 'block'); 97 } 98 } 99 100 if ($('.photo-slider').length) { 101 102 var stdPhotoSliderSettings = { 103 slidesToShow: 3, 104 slidesToScroll: 1, 105 infinite: true, 106 dots: false, 107 arrows: (totalSlideItem > 3 ? true : false), 108 draggable: false, 109 responsive: [ 110 { 111 breakpoint: 800, 112 settings: { 113 slidesToShow: 2, 114 slidesToScroll: 2 115 } 116 }, 117 { 118 breakpoint: 480, 119 settings: { 120 slidesToShow: 1, 121 slidesToScroll: 1 122 } 123 } 124 ] 125 } 126 127 if (typeof window.UMGGR_Home_Photo_Slick_Slider_Option != "undefined") { // 128 var mergedPhotoSliderSettings = {...stdPhotoSliderSettings, ...window.UMGGR_Home_Photo_Slick_Slider_Option}; 129 } else { 130 var mergedPhotoSliderSettings = stdPhotoSliderSettings; 131 } 132 133 var totalSlideItem = $('.photo-slider .slider-gr-slide').length 134 $('.photo-slider').not('.slick-initialized').slick(mergedPhotoSliderSettings); 135 } 136 } 137 $(document).ready(function () 138 { 139 enq(); 140 init(); 141 //SliderGR rollovers 142 $('.slider-gr-slide').mouseenter(function () { 143 TweenMax.to($(this).find('.slide-snippet'), 0.3, {opacity: 1}); 144 TweenMax.to($(this).find('.slide-overlay'), 0.3, {opacity: 0.8}); 145 TweenMax.to($(this).find('.slide-image img'), 0.3, {scale: 1.2}); 146 TweenMax.fromTo($(this).find('.icon'), 0.3, {rotation: -20}, {rotation: 0}); 147 }); 148 $('.slider-gr-slide').mouseleave(function () { 149 TweenMax.to($(this).find('.slide-snippet'), 0.3, {opacity: 0.8}); 150 TweenMax.to($(this).find('.slide-overlay'), 0.3, {opacity: 0}); 151 TweenMax.to($(this).find('.slide-image img'), 0.3, {scale: 1}); 152 TweenMax.to($(this).find('.icon'), 0.3, {rotation: -20}); 153 }); 154 $('.flex-grid-gr-slide').mouseenter(function () { 155 TweenMax.to($(this).find('.slide-overlay'), 0.3, {opacity: 0.5}); 156 TweenMax.to($(this).find('.image-overlay'), 0.3, {scale: 1.2}); 157 TweenMax.to($(this).find('.slide-snippet'),0.3,{opacity:1}); 158 TweenMax.fromTo($(this).find('.plus'), 0.3, {rotation: -20}, {rotation: 0}); 159 }); 160 //News Grid GR rollovers 161 $('.flex-grid-gr-slide').mouseleave(function () { 162 TweenMax.to($(this).find('.slide-overlay'), 0.3, {opacity: 0}); 163 TweenMax.to($(this).find('.image-overlay'), 0.3, {scale: 1}); 164 TweenMax.to($(this).find('.slide-snippet'),0.3,{opacity:0.8}); 165 TweenMax.to($(this).find('.plus'), 0.3, {rotation: -20}); 166 }); 167 $('.roll-link').mouseenter(function () { 168 TweenMax.to($(this), 0.2, {x: -10}); 169 TweenMax.to($(this).find('.fa'), 0.3, {x: 5}); 170 }); 171 $('.roll-link').mouseleave(function () { 172 TweenMax.to($(this), 0.2, {x: 0}); 173 TweenMax.to($(this).find('.fa'), 0.3, {x: 0}); 174 }); 175 $(window).resize(function () { 176 init(); 177 }); 178 $(window).load(function () { 179 init(); 180 }); 181 });
182 183})(jQuery);// JavaScript Document
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.