jQuery(document).ready(function($) { $( "#menu-toggle" ).on("click touchend", function(e) { e.preventDefault(); $( ".main-menu" ).toggleClass( "menu-out" ); $( "#menu-toggle").toggleClass( "icon-x" ); $( "body" ).toggleClass("pushover"); $( "#menu-close" ).fadeToggle(400); }); $( '.menu-item-has-children > a >span ' ).on("click touchend", function(e){ e.preventDefault(); $(this).toggleClass('menu-open').parent().next('.sub-menu').slideToggle(); }); $('#menu-close').on( "click touchend", function(e){ e.preventDefault(); $( ".main-menu" ).removeClass( "menu-out" ); $( "#menu-toggle").removeClass( "icon-x" ); $( "body" ).removeClass("pushover"); $(this).fadeOut(); }); $(document).keyup(function(e) { if(e.keyCode === 27) { $( ".main-menu" ).removeClass( "menu-out" ); $( "#menu-toggle" ).removeClass( "icon-x" ); $( "#menu-close" ).fadeOut(); $( "body" ).removeClass("pushover"); } }); // $('.flick-holder').flickity({ // imagesLoaded : true, // percentPosition : true, // wrapAround : true, // autoPlay : 5500, // pageDots : false // }); if (window.matchMedia('(max-width: 767px)').matches) { } else { $('.home .site-title').addClass('preload'); } $('.flyout-toggle').on("click", function(){ $('.flyout').toggleClass('opened'); $('.header-wrapper').removeClass('opened'); $('.site-title').removeClass('hover'); $('.site-title').removeClass('preload'); }); $('.header-toggle').on("click", function(){ $('.header-wrapper').toggleClass('opened'); $('.site-title').toggleClass('hover'); $('.flyout').removeClass('opened'); $('.site-title').removeClass('preload'); }); $('.header-toggle').on('mouseenter', function(){ $(this).removeClass('new'); }); $('.site-title').on('mouseenter', function(){ $(this).removeClass('preload'); }); window.setTimeout(function(){ $(".header-wrapper").removeClass("opened"); }, 300); $(window).on("resize load", function(){ var hbh = $('#header-banner').height(); var fh = $('.footer-wrapper').height(); $('.page-wrapper').css( { 'padding-top' : hbh * .55 + 'px', 'margin-bottom' : fh + 'px' } ); }); // swipers // flickity $('.swiper').addClass('settled'); var $cheese = $('.swiper').flickity({ // options cellAlign: 'center', imagesLoaded : true, pageDots : false, wrapAround : true, autoPlay: 2500, prevNextButtons : true, freeScroll: true, dragThreshold: 10, freeScrollFriction: 0.04, }); $cheese.on('dragEnd.flickity', function(){ setTimeout( function() { $('.swiper').addClass('settled'); }, .1 ); }); $cheese.on('dragStart.flickity', function(){ $(this).removeClass('settled'); }); // var mySwiper = new Swiper ('.swiper-container', { // // Optional parameters // slidesPerView: 'auto', // centeredSlides:true, // spaceBetween: 30, // loop:true // }); $(document).on("click", ".settled .card-front", function(){ $(this).closest('.swipe-card').addClass('flipped'); }); $('.unflip').on("click", function(){ $(this).closest('.swipe-card').removeClass('flipped'); }); // social var $whatdis = $('.social-cards.no-print').flickity({ cellAlign : 'center', pageDots : false, prevNextButtons : false, imagesLoaded : true, contain : true, initialIndex: 2 }); $('.content-block-inner iframe').wrap('
'); function isIOS() { var ua = window.navigator.userAgent; return /(iPad|iPhone|iPod).*WebKit/.test(ua) && !/(CriOS|OPiOS)/.test(ua); } if(isIOS()) { // $("body").css({ // "height" : "100%", // "overflow-y" : "scroll", // "-webkit-overflow-scrolling" : "touch" // }); // $("html").css({ // "height" : "100%", // "overflow-y" : "scroll", // "-webkit-overflow-scrolling" : "touch" // }); } $(document).ready(function() { $('.hideme').each( function(i){ var bottom_of_object = $(this).position().top + ($(this).outerHeight() / 4); var bottom_of_window = $(window).scrollTop() + $(window).height(); /* If the object is completely visible in the window, fade it it */ if( bottom_of_window > bottom_of_object ){ $(this).addClass('is-visible'); } }); /* Every time the window is scrolled ... */ $(window).scroll( function(){ /* Check the location of each desired element */ $('.hideme').each( function(i){ var bottom_of_object = $(this).position().top + ($(this).outerHeight() / 4); var bottom_of_window = $(window).scrollTop() + $(window).height(); /* If the object is completely visible in the window, fade it it */ if( bottom_of_window > bottom_of_object ){ $(this).addClass('is-visible'); } }); }); }); });