1jQuery(function($){ 2 "use strict"; 3 4 /* Mobile Menu */ 5 jQuery(function () { 6 jQuery('header nav.site-navigation').meanmenu(); 7 }); 8 9 /* Menu accessibility */ 10 $( 'li.menu-item a' ).on({ 11 focusin : function( e ) { 12 $( this ).addClass( 'focus' ); 13 14 if( $( this ).parents( 'li' ).find( '> ul' ) ) { 15 $( this ).parents( 'li' ).each( function() { 16 $( this ).addClass( 'show' ); 17 }); 18 } 19 }, 20 focusout : function( e ) { 21 $( this ).removeClass( 'focus' ); 22 23 if( $( this ).parents( 'li' ).find( '> ul' ).is( ':visible' ) ) { 24 $( this ).parents( 'li' ).removeClass( 'show' ); 25 } 26 } 27 }); 28 29 /* Menu */ 30 // Following http://stackoverflow.com/questions/11512032/detect-if-dropdown-navigation-would-go-off-screen-and-reposition-it 31 $( '.nav-menu li.menu-item-has-children' ).on('mouseenter mouseleave focusin', function (e) { 32 e.stopPropagation(); 33 34 if (jQuery('ul.sub-menu', this).length) { 35 // Fix for focusin 36 if( $('ul.sub-menu', this).hasClass( 'off-screen' ) ) { 37 $('ul.sub-menu', this).addClass('off-screen'); 38 return; 39 } 40 41 var elm = jQuery('ul:first', this); 42 var off = elm.offset(); 43 var l = off.left; 44 var w = elm.width(); 45 var docW = jQuery(window).width(); 46 47 var isEntirelyVisible = (l + w <= docW); 48 49 if (!isEntirelyVisible) { 50 $('ul.sub-menu', this).addClass('off-screen'); 51 } else { 52 $('ul.sub-menu', this).removeClass('off-screen'); 53 } 54 } 55 }); 56 57 /* FitVids */ 58 jQuery(function(){ 59 // Target your .container, .wrapper, .post, etc. 60 jQuery(".WPlookLatestNews .image, iframe").fitVids(); 61 }); 62 63 64 jQuery('body').stellar({ 65 responsive: true, 66 horizontalScrolling: false, 67 verticalScrolling: true, 68 parallaxBackgrounds: true, 69 parallaxElements: true, 70 hideDistantElements: true 71 }); 72 73 /* Masonry */ 74 jQuery(window).ready(function() { 75 var jQuerycontainer = jQuery('.js-masonry'); 76 jQuerycontainer.imagesLoaded(function(){ 77 jQuerycontainer.masonry({ 78 itemSelector: '.candidate', 79 columnWidth: 1, 80 isAnimated: true, 81 animationOptions: { 82 duration: 750, 83 easing: 'easeInOutCirc', 84 queue: false 85 } 86 }); 87 88 }); 89 }); 90 91 /* Flex Slider Teaser */ 92 jQuery('.flexslider').flexslider({ 93 animation: "fade", 94 animationLoop: true, 95 pauseOnAction: true, 96 pauseOnHover: true, 97 controlNav: "thumbnails", 98 start: function(slider) { 99 jQuery( '.flexslider' ).removeClass('loading'); 100 } 101 }); 102 103 /* Featured News Slider */ 104 jQuery('.flexslider-news').flexslider({ 105 controlNav: false, 106 directionNav:true, 107 animationLoop: true, 108 animation: "fade", 109 useCSS: true, 110 smoothHeight: true, 111 slideshow: false, 112 slideshowSpeed:3000, 113 pauseOnAction: true, 114 touch: true, 115 animationSpeed: 900, 116 start: function(slider) { 117 jQuery( '.flexslider-news' ).removeClass('loading'); 118 } 119 }); 120 121 /* Gallery Posts Slider */ 122 123 jQuery('#flexslider-gallery-carousel').flexslider({ 124 animation: "slide", 125 controlNav: false, 126 animationLoop: false, 127 slideshow: true, 128 itemWidth: 150, 129 asNavFor: '.flexslider-gallery' 130 }); 131 132 jQuery('.flexslider-gallery').flexslider({ 133 animation: "fade", 134 controlNav: false, 135 animationLoop: false, 136 slideshow: false, 137 sync: "#flexslider-gallery-carousel", 138 start: function(slider) { 139 jQuery( '.flexslider-gallery' ).removeClass('loading'); 140 } 141 }); 142 143 144 /* Toggle for Causes */ 145 jQuery(".donate_now").on("click", function() { 146 jQuery(".paymend_detailes").toggle(); 147 }); 148 149 /* Toggle donate*/ 150 jQuery(".toggle-content-donation .expand-button").on("click", function() { 151 jQuery(this).toggleClass('close').parent('div').find('.expand').slideToggle(250); 152 }); 153 154 /* Toggle for Events */ 155 if( jQuery( '.wplook-google-map' ).length > 0 ) { 156 jQuery( '.event-address' ).on("click", function() { 157 jQuery( '.event-map' ).toggle( function() { 158 jQuery( '.event-map .wplook-google-map' ).wplGoogleMaps(); 159 }); 160 }); 161 } 162 163 /* Toggle for Share buttons */ 164 jQuery(".share-buttons").on("click", function() { 165 jQuery(".share-items").toggle(); 166 }); 167 168 jQuery(".bookplace").on("click", function() { 169 jQuery(".book-your-place").toggle('slow'); 170 }); 171 172 /* Stick the menu */ 173 jQuery(function() { 174 // grab the initial top offset of the navigation 175 var sticky_navigation_offset_top = jQuery('#sticky_navigation').offset().top+40; 176 177 // our function that decides weather the navigation bar should have "fixed" css position or not. 178 var sticky_navigation = function(){ 179 var scroll_top = jQuery(document).scrollTop(); // our current vertical position from the top 180 181 // if we've scrolled more than the navigation, change its position to fixed to stick to top, otherwise change it back to relative 182 if (scroll_top > sticky_navigation_offset_top) { 183 jQuery('#sticky_navigation').stop(true).animate({ 'padding':'5px 0;','min-height':'60px','opacity' : 0.99 }, 500); 184 jQuery('#sticky_navigation').css({'position': 'fixed', 'top':0, 'left':0 }); 185 } else { 186 jQuery('#sticky_navigation').stop(true).animate({ 'padding':'20px 0;','min-height':'60px', 'opacity' : 1}, 100); 187 jQuery('#sticky_navigation').css({ 'position': 'relative' }); 188 } 189 }; 190 191 sticky_navigation(); 192 193 jQuery(window).scroll(function() { 194 sticky_navigation(); 195 }); 196 197 }); 198 199 200 /* Tabs */ 201 jQuery('.panes div').hide(); 202 jQuery(".tabs a:first").addClass("selected"); 203 jQuery(".tabs_table").each(function(){ 204 jQuery(this).find('.panes div:first').show(); 205 jQuery(this).find('a:first').addClass("selected"); 206 }); 207 jQuery('.tabs a').click(function(){ 208 var which = jQuery(this).attr("rel"); 209 jQuery(this).parents(".tabs_table").find(".selected").removeClass("selected"); 210 jQuery(this).addClass("selected"); 211 jQuery(this).parents(".tabs_table").find(".panes").find("div").hide(); 212 jQuery(this).parents(".tabs_table").find(".panes").find("#"+which).fadeIn(800); 213 }); 214 215 /* Toggle */ 216 jQuery(".toggle-content .expand-button").click(function() { 217 jQuery(this).toggleClass('close').parent('div').find('.expand').slideToggle(250); 218 }); 219 220}); 221 222// Share buttons 223function twwindows(object) { 224 window.open( object, "twshare", "height=400,width=550,resizable=1,toolbar=0,menubar=0,status=0,location=0" ) 225} 226 227function fbwindows(object) { 228 window.open( object, "fbshare", "height=380,width=660,resizable=0,toolbar=0,menubar=0,status=0,location=0,scrollbars=0" ) 229} 230 231function pinwindows(object) { 232 window.open( object, "pinshare", "height=270,width=630,resizable=0,toolbar=0,menubar=0,status=0,location=0,scrollbars=0" ) 233}
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.