$('.cd-secondary-nav .item a[href=#]').click(function(e) { e.preventDefault(); }); $('.cd-secondary-nav .go-back a[href=#]').click(function(e) { e.preventDefault(); }); $('.menu-content li.parent a[href=#]').click(function(e) { e.preventDefault(); }); $('.menu-content .parent a[href=#]').click(function(e) { e.preventDefault(); }); $('.nav-tabs a[href=#]').click(function(e) { e.preventDefault(); }); jQuery(document).ready(function($){ //if you change this breakpoint in the style.css file (or _layout.scss if you use SASS), don't forget to update this value as well var MqL =1024; //move nav element position according to window width moveNavigation(); $(window).on('resize', function(){ (!window.requestAnimationFrame) ? setTimeout(moveNavigation, 300) : window.requestAnimationFrame(moveNavigation); }); //mobile - open lateral menu clicking on the menu icon $('.cd-nav-trigger').on('click', function(event){ event.preventDefault(); if( $('.cd-main-content').hasClass('nav-is-visible') ) { closeNav(); $('.cd-overlay').removeClass('is-visible'); } else { $(this).addClass('nav-is-visible'); $('.cd-primary-nav').addClass('nav-is-visible'); $('.cd-main-header').addClass('nav-is-visible'); $('.cd-main-content').addClass('nav-is-visible').one('webkitTransitionEnd otransitionend oTransitionEnd msTransitionEnd transitionend', function(){ $('body').addClass('overflow-hidden'); }); toggleSearch('close'); $('.cd-overlay').addClass('is-visible'); } }); //open search form $('.cd-search-trigger').on('click', function(event){ event.preventDefault(); toggleSearch(); closeNav(); }); //close lateral menu on mobile $('.cd-overlay').on('swiperight', function(){ if($('.cd-primary-nav').hasClass('nav-is-visible')) { closeNav(); $('.cd-overlay').removeClass('is-visible'); } }); $('.nav-on-left .cd-overlay').on('swipeleft', function(){ if($('.cd-primary-nav').hasClass('nav-is-visible')) { closeNav(); $('.cd-overlay').removeClass('is-visible'); } }); $('.cd-overlay').on('click', function(){ closeNav(); toggleSearch('close') $('.cd-overlay').removeClass('is-visible'); }); //prevent default clicking on direct children of .cd-primary-nav $('.cd-primary-nav').children('.has-children').children('a').on('click', function(event){ event.preventDefault(); }); //open submenu $('.has-children').children('a').on('click', function(event){ if( !checkWindowWidth() ) event.preventDefault(); var selected = $(this); if( selected.next('ul').hasClass('is-hidden') ) { //desktop version only selected.addClass('selected').next('ul').removeClass('is-hidden').end().parent('.has-children').parent('ul').addClass('moves-out'); selected.parent('.has-children').siblings('.has-children').children('ul').addClass('is-hidden').end().children('a').removeClass('selected'); $('.cd-overlay').addClass('is-visible'); } else { selected.removeClass('selected').next('ul').addClass('is-hidden').end().parent('.has-children').parent('ul').removeClass('moves-out'); $('.cd-overlay').removeClass('is-visible'); } toggleSearch('close'); }); //submenu items - go back link $('.go-back').on('click', function(){ $(this).parent('ul').addClass('is-hidden').parent('.has-children').parent('ul').removeClass('moves-out'); }); function closeNav() { $('.cd-nav-trigger').removeClass('nav-is-visible'); $('.cd-main-header').removeClass('nav-is-visible'); $('.cd-primary-nav').removeClass('nav-is-visible'); $('.has-children ul').addClass('is-hidden'); $('.has-children a').removeClass('selected'); $('.moves-out').removeClass('moves-out'); $('.cd-main-content').removeClass('nav-is-visible').one('webkitTransitionEnd otransitionend oTransitionEnd msTransitionEnd transitionend', function(){ $('body').removeClass('overflow-hidden'); }); } function toggleSearch(type) { if(type=="close") { //close serach $('.cd-search').removeClass('is-visible'); $('.cd-search-trigger').removeClass('search-is-visible'); $('.cd-overlay').removeClass('search-is-visible'); } else { //toggle search visibility $('.cd-search').toggleClass('is-visible'); $('.cd-search-trigger').toggleClass('search-is-visible'); $('.cd-overlay').toggleClass('search-is-visible'); if($(window).width() > MqL && $('.cd-search').hasClass('is-visible')) $('.cd-search').find('input[type="search"]').focus(); ($('.cd-search').hasClass('is-visible')) ? $('.cd-overlay').addClass('is-visible') : $('.cd-overlay').removeClass('is-visible') ; } } function checkWindowWidth() { //check window width (scrollbar included) var e = window, a = 'inner'; if (!('innerWidth' in window )) { a = 'client'; e = document.documentElement || document.body; } if ( e[ a+'Width' ] >= MqL ) { return true; } else { return false; } } function moveNavigation(){ var navigation = $('.cd-nav'); var desktop = checkWindowWidth(); if ( desktop ) { navigation.detach(); navigation.insertBefore('.cd-header-buttons'); } else { navigation.detach(); navigation.insertAfter('.cd-main-content'); } } }); $(".selectpicker select").select2({ allowClear: true, minimumResultsForSearch: -1 }); $("select.cms_dropdown").select2({ allowClear: true, minimumResultsForSearch: -1 }); $('#main-slider').flexslider({ pauseOnHover : true, controlNav : false, slideshow : true, slideshowSpeed : 10000, animationSpeed : 600, initDelay : 2000, directionNav : true, start: function(slider){ $('body').removeClass('loading'); $(slider).find(".flex-active-slide").find('.f_flash').addClass("animated flash"); $(slider).find(".flex-active-slide").find('.f_bounce').addClass("animated bounce"); $(slider).find(".flex-active-slide").find('.f_shake').addClass("animated shake"); $(slider).find(".flex-active-slide").find('.f_tada').addClass("animated tada"); $(slider).find(".flex-active-slide").find('.f_swing').addClass("animated swing"); $(slider).find(".flex-active-slide").find('.f_rubberBand').addClass("animated rubberBand"); $(slider).find(".flex-active-slide").find('.f_wobble').addClass("animated wobble"); $(slider).find(".flex-active-slide").find('.f_wiggle').addClass("animated wiggle"); $(slider).find(".flex-active-slide").find('.f_pulse').addClass("animated pulse"); $(slider).find(".flex-active-slide").find('.f_fadeIn').addClass("animated fadeIn"); $(slider).find(".flex-active-slide").find('.f_fadeInUp').addClass("animated fadeInUp"); $(slider).find(".flex-active-slide").find('.f_fadeInDown').addClass("animated fadeInDown"); $(slider).find(".flex-active-slide").find('.f_fadeInLeft').addClass("animated fadeInLeft"); $(slider).find(".flex-active-slide").find('.f_fadeInRight').addClass("animated fadeInRight"); $(slider).find(".flex-active-slide").find('.f_fadeInUpBig').addClass("animated fadeInUpBig"); $(slider).find(".flex-active-slide").find('.f_fadeInDownBig').addClass("animated fadeInDownBig"); $(slider).find(".flex-active-slide").find('.f_fadeInLeftBig').addClass("animated fadeInLeftBig"); $(slider).find(".flex-active-slide").find('.f_fadeInRightBig').addClass("animated fadeInRightBig"); $(slider).find(".flex-active-slide").find('.f_fadeOut').addClass("animated fadeOut"); $(slider).find(".flex-active-slide").find('.f_fadeOutUp').addClass("animated fadeOutUp"); $(slider).find(".flex-active-slide").find('.f_fadeOutDown').addClass("animated fadeOutDown"); $(slider).find(".flex-active-slide").find('.f_fadeOutLeft').addClass("animated fadeOutLeft"); $(slider).find(".flex-active-slide").find('.f_fadeOutRight').addClass("animated fadeOutRight"); $(slider).find(".flex-active-slide").find('.f_fadeOutUpBig').addClass("animated fadeOutUpBig"); $(slider).find(".flex-active-slide").find('.f_fadeOutDownBig').addClass("animated fadeOutDownBig"); $(slider).find(".flex-active-slide").find('.f_fadeOutLeftBig').addClass("animated fadeOutLeftBig"); $(slider).find(".flex-active-slide").find('.f_fadeOutRightBig').addClass("animated fadeOutRightBig"); $(slider).find(".flex-active-slide").find('.f_bounceIn').addClass("animated bounceIn"); $(slider).find(".flex-active-slide").find('.f_bounceInUp').addClass("animated bounceInUp"); $(slider).find(".flex-active-slide").find('.f_bounceInDown').addClass("animated bounceInDown"); $(slider).find(".flex-active-slide").find('.f_bounceInLeft').addClass("animated bounceInLeft"); $(slider).find(".flex-active-slide").find('.f_bounceInRight').addClass("animated bounceInRight"); $(slider).find(".flex-active-slide").find('.f_bounceOut').addClass("animated bounceOut"); $(slider).find(".flex-active-slide").find('.f_bounceOutUp').addClass("animated bounceOutUp"); $(slider).find(".flex-active-slide").find('.f_bounceOutDown').addClass("animated bounceOutDown"); $(slider).find(".flex-active-slide").find('.f_bounceOutLeft').addClass("animated bounceOutLeft"); $(slider).find(".flex-active-slide").find('.f_bounceOutRight').addClass("animated bounceOutRight"); $(slider).find(".flex-active-slide").find('.f_flip').addClass("animated flip"); $(slider).find(".flex-active-slide").find('.f_flipInX').addClass("animated flipInX"); $(slider).find(".flex-active-slide").find('.f_flipInY').addClass("animated flipInY"); $(slider).find(".flex-active-slide").find('.f_flipOutX').addClass("animated flipOutX"); $(slider).find(".flex-active-slide").find('.f_flipOutY').addClass("animated flipOutY"); $(slider).find(".flex-active-slide").find('.f_lightSpeedIn').addClass("animated lightSpeedIn"); $(slider).find(".flex-active-slide").find('.f_lightSpeedOut').addClass("animated lightSpeedOut"); $(slider).find(".flex-active-slide").find('.f_slideIn').addClass("animated slideIn"); $(slider).find(".flex-active-slide").find('.f_slideInUp').addClass("animated slideInUp"); $(slider).find(".flex-active-slide").find('.f_slideInDown').addClass("animated slideInDown"); $(slider).find(".flex-active-slide").find('.f_slideInLeft').addClass("animated slideInLeft"); $(slider).find(".flex-active-slide").find('.f_slideInRight').addClass("animated slideInRight"); $(slider).find(".flex-active-slide").find('.f_slideOut').addClass("animated slideOut"); $(slider).find(".flex-active-slide").find('.f_slideOutUp').addClass("animated slideOutUp"); $(slider).find(".flex-active-slide").find('.f_slideOutDown').addClass("animated slideOutDown"); $(slider).find(".flex-active-slide").find('.f_slideOutLeft').addClass("animated slideOutLeft"); $(slider).find(".flex-active-slide").find('.f_slideOutRight').addClass("animated slideOutRight"); $(slider).find(".flex-active-slide").find('.f_flip').addClass("animated flip"); $(slider).find(".flex-active-slide").find('.f_flipInX').addClass("animated flipInX"); $(slider).find(".flex-active-slide").find('.f_flipInY').addClass("animated flipInY"); $(slider).find(".flex-active-slide").find('.f_flipOutX').addClass("animated flipOutX"); $(slider).find(".flex-active-slide").find('.f_flipOutY').addClass("animated flipOutY"); $(slider).find(".flex-active-slide").find('.f_slideIn').addClass("animated slideIn"); $(slider).find(".flex-active-slide").find('.f_slideInUp').addClass("animated slideInUp"); $(slider).find(".flex-active-slide").find('.f_slideInDown').addClass("animated slideInDown"); $(slider).find(".flex-active-slide").find('.f_slideInLeft').addClass("animated slideInLeft"); $(slider).find(".flex-active-slide").find('.f_slideInRight').addClass("animated slideInRight"); $(slider).find(".flex-active-slide").find('.f_slideOut').addClass("animated slideOut"); $(slider).find(".flex-active-slide").find('.f_slideOutUp').addClass("animated slideOutUp"); $(slider).find(".flex-active-slide").find('.f_slideOutDown').addClass("animated slideOutDown"); $(slider).find(".flex-active-slide").find('.f_slideOutLeft').addClass("animated slideOutLeft"); $(slider).find(".flex-active-slide").find('.f_slideOutRight').addClass("animated slideOutRight"); $(slider).find(".flex-active-slide").find('.f_rotateIn').addClass("animated rotateIn"); $(slider).find(".flex-active-slide").find('.f_rotateInDownLeft').addClass("animated rotateInDownLeft"); $(slider).find(".flex-active-slide").find('.f_rotateInDownRight').addClass("animated rotateInDownRight"); $(slider).find(".flex-active-slide").find('.f_rotateInUpLeft').addClass("animated rotateInUpLeft"); $(slider).find(".flex-active-slide").find('.f_rotateInUpRight').addClass("animated rotateInUpRight"); $(slider).find(".flex-active-slide").find('.f_rotateOut').addClass("animated rotateOut"); $(slider).find(".flex-active-slide").find('.f_rotateOutDownLeft').addClass("animated rotateOutDownLeft"); $(slider).find(".flex-active-slide").find('.f_rotateOutDownRight').addClass("animated rotateOutDownRight"); $(slider).find(".flex-active-slide").find('.f_rotateOutUpLeft').addClass("animated rotateOutUpLeft"); $(slider).find(".flex-active-slide").find('.f_rotateOutUpRight').addClass("animated rotateOutUpRight"); $(slider).find(".flex-active-slide").find('.f_zoomIn').addClass("animated zoomIn"); $(slider).find(".flex-active-slide").find('.f_zoomInUp').addClass("animated zoomInUp"); $(slider).find(".flex-active-slide").find('.f_zoomInDown').addClass("animated zoomInDown"); $(slider).find(".flex-active-slide").find('.f_zoomInLeft').addClass("animated zoomInLeft"); $(slider).find(".flex-active-slide").find('.f_zoomInRight').addClass("animated zoomInRight"); $(slider).find(".flex-active-slide").find('.f_zoomOut').addClass("animated zoomOut"); $(slider).find(".flex-active-slide").find('.f_zoomOutUp').addClass("animated zoomOutUp"); $(slider).find(".flex-active-slide").find('.f_zoomOutDown').addClass("animated zoomOutDown"); $(slider).find(".flex-active-slide").find('.f_zoomOutLeft').addClass("animated zoomOutLeft"); $(slider).find(".flex-active-slide").find('.f_zoomOutRight').addClass("animated zoomOutRight"); }, before: function(slider){ $(slider).find(".flex-active-slide").find('.f_flash').each(function(){ $(this).removeClass("animated flash"); }); $(slider).find(".flex-active-slide").find('.f_bounce').each(function(){ $(this).removeClass("animated bounce"); }); $(slider).find(".flex-active-slide").find('.f_shake').each(function(){ $(this).removeClass("animated shake"); }); $(slider).find(".flex-active-slide").find('.f_tada').each(function(){ $(this).removeClass("animated tada"); }); $(slider).find(".flex-active-slide").find('.f_swing').each(function(){ $(this).removeClass("animated tada"); }); $(slider).find(".flex-active-slide").find('.f_rubberBand').each(function(){ $(this).removeClass("animated rubberBand"); }); $(slider).find(".flex-active-slide").find('.f_wobble').each(function(){ $(this).removeClass("animated wobble"); }); $(slider).find(".flex-active-slide").find('.f_wiggle').each(function(){ $(this).removeClass("animated wiggle"); }); $(slider).find(".flex-active-slide").find('.f_pulse').each(function(){ $(this).removeClass("animated pulse"); }); $(slider).find(".flex-active-slide").find('.f_pulse').each(function(){ $(this).removeClass("animated pulse"); }); $(slider).find(".flex-active-slide").find('.f_fadeIn').each(function(){ $(this).removeClass("animated fadeIn"); }); $(slider).find(".flex-active-slide").find('.f_fadeInUp').each(function(){ $(this).removeClass("animated fadeInUp"); }); $(slider).find(".flex-active-slide").find('.f_fadeInDown').each(function(){ $(this).removeClass("animated fadeInDown"); }); $(slider).find(".flex-active-slide").find('.f_fadeInLeft').each(function(){ $(this).removeClass("animated fadeInLeft"); }); $(slider).find(".flex-active-slide").find('.f_fadeInRight').each(function(){ $(this).removeClass("animated fadeInRight"); }); $(slider).find(".flex-active-slide").find('.f_fadeInUpBig').each(function(){ $(this).removeClass("animated fadeInUpBig"); }); $(slider).find(".flex-active-slide").find('.f_fadeInDownBig').each(function(){ $(this).removeClass("animated fadeInDownBig"); }); $(slider).find(".flex-active-slide").find('.f_fadeInLeftBig').each(function(){ $(this).removeClass("animated fadeInLeftBig"); }); $(slider).find(".flex-active-slide").find('.f_fadeOut').each(function(){ $(this).removeClass("animated fadeOut"); }); $(slider).find(".flex-active-slide").find('.f_fadeOutUp').each(function(){ $(this).removeClass("animated fadeOutUp"); }); $(slider).find(".flex-active-slide").find('.f_fadeOutDown').each(function(){ $(this).removeClass("animated fadeOutDown"); }); $(slider).find(".flex-active-slide").find('.f_fadeOutLeft').each(function(){ $(this).removeClass("animated fadeOutLeft"); }); $(slider).find(".flex-active-slide").find('.f_fadeOutRight').each(function(){ $(this).removeClass("animated fadeInRight"); }); $(slider).find(".flex-active-slide").find('.f_fadeOutUpBig').each(function(){ $(this).removeClass("animated fadeOutUpBig"); }); $(slider).find(".flex-active-slide").find('.f_fadeOutDownBig').each(function(){ $(this).removeClass("animated fadeOutDownBig"); }); $(slider).find(".flex-active-slide").find('.f_fadeOutLeftBig').each(function(){ $(this).removeClass("animated fadeOutLeftBig"); }); $(slider).find(".flex-active-slide").find('.f_bounceIn').each(function(){ $(this).removeClass("animated bounceIn"); }); $(slider).find(".flex-active-slide").find('.f_bounceInDown').each(function(){ $(this).removeClass("animated bounceInDown"); }); $(slider).find(".flex-active-slide").find('.f_bounceInUp').each(function(){ $(this).removeClass("animated bounceInUp"); }); $(slider).find(".flex-active-slide").find('.f_bounceInLeft').each(function(){ $(this).removeClass("animated bounceInLeft"); }); $(slider).find(".flex-active-slide").find('.f_bounceInRight').each(function(){ $(this).removeClass("animated bounceInRight"); }); $(slider).find(".flex-active-slide").find('.f_bounceOut').each(function(){ $(this).removeClass("animated bounceOut"); }); $(slider).find(".flex-active-slide").find('.f_bounceOutUp').each(function(){ $(this).removeClass("animated bounceOutUp"); }); $(slider).find(".flex-active-slide").find('.f_bounceOutDown').each(function(){ $(this).removeClass("animated bounceOutDown"); }); $(slider).find(".flex-active-slide").find('.f_bounceOutLeft').each(function(){ $(this).removeClass("animated bounceOutLeft"); }); $(slider).find(".flex-active-slide").find('.f_bounceOutRight').each(function(){ $(this).removeClass("animated bounceOutRight"); }); $(slider).find(".flex-active-slide").find('.f_flip').each(function(){ $(this).removeClass("animated flip"); }); $(slider).find(".flex-active-slide").find('.f_flipInX').each(function(){ $(this).removeClass("animated flipInX"); }); $(slider).find(".flex-active-slide").find('.f_flipInY').each(function(){ $(this).removeClass("animated flipInY"); }); $(slider).find(".flex-active-slide").find('.f_flipOutX').each(function(){ $(this).removeClass("animated flipOutX"); }); $(slider).find(".flex-active-slide").find('.f_flipOutY').each(function(){ $(this).removeClass("animated flipOutY"); }); $(slider).find(".flex-active-slide").find('.f_lightSpeedIn').each(function(){ $(this).removeClass("animated lightSpeedIn"); }); $(slider).find(".flex-active-slide").find('.f_lightSpeedOut').each(function(){ $(this).removeClass("animated lightSpeedOut"); }); $(slider).find(".flex-active-slide").find('.f_slideIn').each(function(){ $(this).removeClass("animated slideIn"); }); $(slider).find(".flex-active-slide").find('.f_slideInUp').each(function(){ $(this).removeClass("animated slideInUp"); }); $(slider).find(".flex-active-slide").find('.f_slideInDown').each(function(){ $(this).removeClass("animated slideInDown"); }); $(slider).find(".flex-active-slide").find('.f_slideInLeft').each(function(){ $(this).removeClass("animated slideInLeft"); }); $(slider).find(".flex-active-slide").find('.f_slideInRight').each(function(){ $(this).removeClass("animated slideInRight"); }); $(slider).find(".flex-active-slide").find('.f_slideOut').each(function(){ $(this).removeClass("animated slideOut"); }); $(slider).find(".flex-active-slide").find('.f_slideOutUp').each(function(){ $(this).removeClass("animated slideOutUp"); }); $(slider).find(".flex-active-slide").find('.f_slideOutDown').each(function(){ $(this).removeClass("animated slideOutDown"); }); $(slider).find(".flex-active-slide").find('.f_slideOutLeft').each(function(){ $(this).removeClass("animated slideOutLeft"); }); $(slider).find(".flex-active-slide").find('.f_slideOutRight').each(function(){ $(this).removeClass("animated slideOutRight"); }); $(slider).find(".flex-active-slide").find('.f_rotateIn').each(function(){ $(this).removeClass("animated rotateIn"); }); $(slider).find(".flex-active-slide").find('.f_rotateInDownLeft').each(function(){ $(this).removeClass("animated rotateInDownLeft"); }); $(slider).find(".flex-active-slide").find('.f_rotateInDownRight').each(function(){ $(this).removeClass("animated rotateInDownRight"); }); $(slider).find(".flex-active-slide").find('.f_rotateInUpLeft').each(function(){ $(this).removeClass("animated rotateInUpLeft"); }); $(slider).find(".flex-active-slide").find('.f_rotateInUpRight').each(function(){ $(this).removeClass("animated rotateInUpRight"); }); $(slider).find(".flex-active-slide").find('.f_rotateOut').each(function(){ $(this).removeClass("animated rotateOut"); }); $(slider).find(".flex-active-slide").find('.f_rotateOutDownLeft').each(function(){ $(this).removeClass("animated rotateOutDownLeft"); }); $(slider).find(".flex-active-slide").find('.f_rotateOutDownRight').each(function(){ $(this).removeClass("animated rotateOutDownRight"); }); $(slider).find(".flex-active-slide").find('.f_rotateOutUpLeft').each(function(){ $(this).removeClass("animated rotateOutUpLeft"); }); $(slider).find(".flex-active-slide").find('.f_rotateOutUpRight').each(function(){ $(this).removeClass("animated rotateOutUpRight"); }); $(slider).find(".flex-active-slide").find('.f_zoomIn').each(function(){ $(this).removeClass("animated zoomIn"); }); $(slider).find(".flex-active-slide").find('.f_zoomInDown').each(function(){ $(this).removeClass("animated zoomInDown"); }); $(slider).find(".flex-active-slide").find('.f_zoomInUp').each(function(){ $(this).removeClass("animated zoomInUp"); }); $(slider).find(".flex-active-slide").find('.f_zoomInLeft').each(function(){ $(this).removeClass("animated zoomInLeft"); }); $(slider).find(".flex-active-slide").find('.f_zoomInRight').each(function(){ $(this).removeClass("animated zoomInRight"); }); $(slider).find(".flex-active-slide").find('.f_zoomOut').each(function(){ $(this).removeClass("animated zoomOut"); }); $(slider).find(".flex-active-slide").find('.f_zoomOutDown').each(function(){ $(this).removeClass("animated zoomOutDown"); }); $(slider).find(".flex-active-slide").find('.f_zoomOutUp').each(function(){ $(this).removeClass("animated zoomOutUp"); }); $(slider).find(".flex-active-slide").find('.f_zoomOutLeft').each(function(){ $(this).removeClass("animated zoomOutLeft"); }); $(slider).find(".flex-active-slide").find('.f_zoomOutRight').each(function(){ $(this).removeClass("animated zoomOutRight"); }); }, after: function(slider){ $(slider).find(".flex-active-slide").find('.f_flash').addClass("animated flash"); $(slider).find(".flex-active-slide").find('.f_bounce').addClass("animated bounce"); $(slider).find(".flex-active-slide").find('.f_shake').addClass("animated shake"); $(slider).find(".flex-active-slide").find('.f_tada').addClass("animated tada"); $(slider).find(".flex-active-slide").find('.f_swing').addClass("animated swing"); $(slider).find(".flex-active-slide").find('.f_rubberBand').addClass("animated rubberBand"); $(slider).find(".flex-active-slide").find('.f_wobble').addClass("animated wobble"); $(slider).find(".flex-active-slide").find('.f_wiggle').addClass("animated wiggle"); $(slider).find(".flex-active-slide").find('.f_pulse').addClass("animated pulse"); $(slider).find(".flex-active-slide").find('.f_fadeIn').addClass("animated fadeIn"); $(slider).find(".flex-active-slide").find('.f_fadeInUp').addClass("animated fadeInUp"); $(slider).find(".flex-active-slide").find('.f_fadeInDown').addClass("animated fadeInDown"); $(slider).find(".flex-active-slide").find('.f_fadeInLeft').addClass("animated fadeInLeft"); $(slider).find(".flex-active-slide").find('.f_fadeInRight').addClass("animated fadeInRight"); $(slider).find(".flex-active-slide").find('.f_fadeInUpBig').addClass("animated fadeInUpBig"); $(slider).find(".flex-active-slide").find('.f_fadeInDownBig').addClass("animated fadeInDownBig"); $(slider).find(".flex-active-slide").find('.f_fadeInLeftBig').addClass("animated fadeInLeftBig"); $(slider).find(".flex-active-slide").find('.f_fadeInRightBig').addClass("animated fadeInRightBig"); $(slider).find(".flex-active-slide").find('.f_fadeOut').addClass("animated fadeOut"); $(slider).find(".flex-active-slide").find('.f_fadeOutUp').addClass("animated fadeOutUp"); $(slider).find(".flex-active-slide").find('.f_fadeOutDown').addClass("animated fadeOutDown"); $(slider).find(".flex-active-slide").find('.f_fadeOutLeft').addClass("animated fadeOutLeft"); $(slider).find(".flex-active-slide").find('.f_fadeOutRight').addClass("animated fadeOutRight"); $(slider).find(".flex-active-slide").find('.f_fadeOutUpBig').addClass("animated fadeOutUpBig"); $(slider).find(".flex-active-slide").find('.f_fadeOutDownBig').addClass("animated fadeOutDownBig"); $(slider).find(".flex-active-slide").find('.f_fadeOutLeftBig').addClass("animated fadeOutLeftBig"); $(slider).find(".flex-active-slide").find('.f_fadeOutRightBig').addClass("animated fadeOutRightBig"); $(slider).find(".flex-active-slide").find('.f_bounceIn').addClass("animated bounceIn"); $(slider).find(".flex-active-slide").find('.f_bounceInUp').addClass("animated bounceInUp"); $(slider).find(".flex-active-slide").find('.f_bounceInDown').addClass("animated bounceInDown"); $(slider).find(".flex-active-slide").find('.f_bounceInLeft').addClass("animated bounceInLeft"); $(slider).find(".flex-active-slide").find('.f_bounceInRight').addClass("animated bounceInRight"); $(slider).find(".flex-active-slide").find('.f_bounceOut').addClass("animated bounceOut"); $(slider).find(".flex-active-slide").find('.f_bounceOutUp').addClass("animated bounceOutUp"); $(slider).find(".flex-active-slide").find('.f_bounceOutDown').addClass("animated bounceOutDown"); $(slider).find(".flex-active-slide").find('.f_bounceOutLeft').addClass("animated bounceOutLeft"); $(slider).find(".flex-active-slide").find('.f_bounceOutRight').addClass("animated bounceOutRight"); $(slider).find(".flex-active-slide").find('.f_flip').addClass("animated flip"); $(slider).find(".flex-active-slide").find('.f_flipInX').addClass("animated flipInX"); $(slider).find(".flex-active-slide").find('.f_flipInY').addClass("animated flipInY"); $(slider).find(".flex-active-slide").find('.f_flipOutX').addClass("animated flipOutX"); $(slider).find(".flex-active-slide").find('.f_flipOutY').addClass("animated flipOutY"); $(slider).find(".flex-active-slide").find('.f_lightSpeedIn').addClass("animated lightSpeedIn"); $(slider).find(".flex-active-slide").find('.f_lightSpeedOut').addClass("animated lightSpeedOut"); $(slider).find(".flex-active-slide").find('.f_slideIn').addClass("animated slideIn"); $(slider).find(".flex-active-slide").find('.f_slideInUp').addClass("animated slideInUp"); $(slider).find(".flex-active-slide").find('.f_slideInDown').addClass("animated slideInDown"); $(slider).find(".flex-active-slide").find('.f_slideInLeft').addClass("animated slideInLeft"); $(slider).find(".flex-active-slide").find('.f_slideInRight').addClass("animated slideInRight"); $(slider).find(".flex-active-slide").find('.f_slideOut').addClass("animated slideOut"); $(slider).find(".flex-active-slide").find('.f_slideOutUp').addClass("animated slideOutUp"); $(slider).find(".flex-active-slide").find('.f_slideOutDown').addClass("animated slideOutDown"); $(slider).find(".flex-active-slide").find('.f_slideOutLeft').addClass("animated slideOutLeft"); $(slider).find(".flex-active-slide").find('.f_slideOutRight').addClass("animated slideOutRight"); $(slider).find(".flex-active-slide").find('.f_flip').addClass("animated flip"); $(slider).find(".flex-active-slide").find('.f_flipInX').addClass("animated flipInX"); $(slider).find(".flex-active-slide").find('.f_flipInY').addClass("animated flipInY"); $(slider).find(".flex-active-slide").find('.f_flipOutX').addClass("animated flipOutX"); $(slider).find(".flex-active-slide").find('.f_flipOutY').addClass("animated flipOutY"); $(slider).find(".flex-active-slide").find('.f_slideIn').addClass("animated slideIn"); $(slider).find(".flex-active-slide").find('.f_slideInUp').addClass("animated slideInUp"); $(slider).find(".flex-active-slide").find('.f_slideInDown').addClass("animated slideInDown"); $(slider).find(".flex-active-slide").find('.f_slideInLeft').addClass("animated slideInLeft"); $(slider).find(".flex-active-slide").find('.f_slideInRight').addClass("animated slideInRight"); $(slider).find(".flex-active-slide").find('.f_slideOut').addClass("animated slideOut"); $(slider).find(".flex-active-slide").find('.f_slideOutUp').addClass("animated slideOutUp"); $(slider).find(".flex-active-slide").find('.f_slideOutDown').addClass("animated slideOutDown"); $(slider).find(".flex-active-slide").find('.f_slideOutLeft').addClass("animated slideOutLeft"); $(slider).find(".flex-active-slide").find('.f_slideOutRight').addClass("animated slideOutRight"); $(slider).find(".flex-active-slide").find('.f_rotateIn').addClass("animated rotateIn"); $(slider).find(".flex-active-slide").find('.f_rotateInDownLeft').addClass("animated rotateInDownLeft"); $(slider).find(".flex-active-slide").find('.f_rotateInDownRight').addClass("animated rotateInDownRight"); $(slider).find(".flex-active-slide").find('.f_rotateInUpLeft').addClass("animated rotateInUpLeft"); $(slider).find(".flex-active-slide").find('.f_rotateInUpRight').addClass("animated rotateInUpRight"); $(slider).find(".flex-active-slide").find('.f_rotateOut').addClass("animated rotateOut"); $(slider).find(".flex-active-slide").find('.f_rotateOutDownLeft').addClass("animated rotateOutDownLeft"); $(slider).find(".flex-active-slide").find('.f_rotateOutDownRight').addClass("animated rotateOutDownRight"); $(slider).find(".flex-active-slide").find('.f_rotateOutUpLeft').addClass("animated rotateOutUpLeft"); $(slider).find(".flex-active-slide").find('.f_rotateOutUpRight').addClass("animated rotateOutUpRight"); $(slider).find(".flex-active-slide").find('.f_zoomIn').addClass("animated zoomIn"); $(slider).find(".flex-active-slide").find('.f_zoomInUp').addClass("animated zoomInUp"); $(slider).find(".flex-active-slide").find('.f_zoomInDown').addClass("animated zoomInDown"); $(slider).find(".flex-active-slide").find('.f_zoomInLeft').addClass("animated zoomInLeft"); $(slider).find(".flex-active-slide").find('.f_zoomInRight').addClass("animated zoomInRight"); $(slider).find(".flex-active-slide").find('.f_zoomOut').addClass("animated zoomOut"); $(slider).find(".flex-active-slide").find('.f_zoomOutUp').addClass("animated zoomOutUp"); $(slider).find(".flex-active-slide").find('.f_zoomOutDown').addClass("animated zoomOutDown"); $(slider).find(".flex-active-slide").find('.f_zoomOutLeft').addClass("animated zoomOutLeft"); $(slider).find(".flex-active-slide").find('.f_zoomOutRight').addClass("animated zoomOutRight"); slider.pause(); slider.play(); } }); $(window).scroll(function() { if ($(document).scrollTop() > 50) { $('.cd-main-header').addClass('shrink'); } else { $('.cd-main-header').removeClass('shrink'); } }); (function() { var header = new Headroom(document.querySelector(".headroom"), { tolerance: 5, offset : 205, classes: { initial: "animated", pinned: "slideDown", unpinned: "slideUp" } }); header.init(); }()); // This adds an offset in case the header is fixed $('a[href*=#]:not([href=#]):not([href=#cd-primary-nav]):not([href=#cd-search])').click(function() { if (location.pathname.replace(/^\//,'') == this.pathname.replace(/^\//,'') || location.hostname == this.hostname) { var target = $(this.hash); target = target.length ? target : $('[name=' + this.hash.slice(1) +']'); if (target.length) { var top_offset = 0; if ( $('.cd-main-header').css('position') == 'fixed' ) { top_offset = $('.cd-main-header').height(); } $('html,body').animate({ scrollTop: target.offset().top - top_offset }, 1000); return false; } } }); (function() { // store the slider in a local variable var $window = $(window), flexslider = { vars:{} }; // tiny helper function to add breakpoints function getGridSize() { return (window.innerWidth < 400) ? 1 : (window.innerWidth < 980) ? 2 : 4; } $window.load(function() { $('#photo-slider').flexslider({ animation: "slide", slideshow: false, animationLoop: true, itemWidth: 282, itemMargin: 0, controlNav : false, minItems: getGridSize(), // use function to pull in initial value maxItems: getGridSize(), // use function to pull in initial value start: function(slider){flexslider = slider;}, after: function(slider){ slider.pause(); slider.play();} }); }); // check grid size on resize event $window.resize(function() { var gridSize = getGridSize(); flexslider.vars.minItems = gridSize; flexslider.vars.maxItems = gridSize; }); }()); $(window).load(function() { // The slider being synced must be initialized first $('#flexslider').flexslider({ animation: "slide", controlNav: false, animationLoop: true, slideshow: true }); }); $(document).ready(function () { $.validator.setDefaults({ ignore: [] }); $('#cntnt01moduleform_2').validate({ errorElement: 'span', errorClass: 'error', rules: { singleselect:'required', multipleselect:'required', name:'required' }, highlight: function (element, errorClass, validClass) { var elem = $(element); if(elem.hasClass('s-select2')) { var isMulti = (!!elem.attr('multiple')) ? 's' : ''; elem.siblings('.selectpicker select').find('.select2-choice'+isMulti+'').addClass(errorClass); } else { elem.addClass(errorClass); } if(elem.hasClass('big-radio')) { var isMulti = (!!elem.attr('multiple')) ? 's' : ''; elem.siblings('.selectpicker').find('.select2-choice'+isMulti+'').addClass(errorClass); } else { elem.addClass(errorClass); } }, unhighlight: function (element, errorClass, validClass) { var elem = $(element); if(elem.hasClass('selectpicker')) { elem.siblings('.selectpicker').find('.select2-choice').removeClass(errorClass); } else { elem.removeClass(errorClass); } } }); $('select').on('change', function() { $(this).valid(); }); }); $(window).load(function() { // The slider being synced must be initialized first $('#news').flexslider({ animation: "slide", controlNav: true, directionNav: false, animationLoop: true, slideshowSpeed: 5000, pauseOnAction: true, pauseOnHover: true, slideshow: true }); }); $(window).load(function() { // The slider being synced must be initialized first $('#events').flexslider({ animation: "slide", controlNav: true, directionNav: false, animationLoop: true, slideshowSpeed: 5000, pauseOnAction: true, pauseOnHover: true, slideshow: true }); }); $(function() { // Setup the player to autoplay the next track var a = audiojs.createAll({ trackEnded: function() { var next = $('ol li.playing').next(); if (!next.length) next = $('ol li').first(); $('ol li').removeClass('playing'); next.addClass('playing');//.siblings().removeClass('playing'); audio.load($('a', next).attr('data-src')); audio.play(); } }); // Load in the first track var audio = a[0]; first = $('ol a').attr('data-src'); $('ol li').first().addClass('playing'); audio.load(first); // Load in a track on click $('ol li').click(function(e) { e.preventDefault(); $('ol li').removeClass('playing'); $(this).addClass('playing');//.siblings().removeClass('playing'); audio.load($('a', this).attr('data-src')); audio.play(); }); // Keyboard shortcuts $(document).keydown(function(e) { var unicode = e.charCode ? e.charCode : e.keyCode; // right arrow if (unicode == 39) { var next = $('li.playing').next(); if (!next.length) next = $('ol li').first(); next.click(); // back arrow } else if (unicode == 37) { var prev = $('li.playing').prev(); if (!prev.length) prev = $('ol li').last(); prev.click(); // spacebar } else if (unicode == 32) { audio.playPause(); } }) }); function neueFade() { $(this).hide().fadeIn(200); } document.addEventListener('play', function(e){ var audios = document.getElementsByTagName('audio'); for(var i = 0, len = audios.length; i < len;i++){ if(audios[i] != e.target){ audios[i].pause(); } } }, true);