/* global abletoneOptions */ /* * Custom scripts * Description: Custom scripts for abletone */ ( function( $ ) { // Owl Carousel if ( $.isFunction( $.fn.owlCarousel ) ) { // Featured Slider var sliderOptions = { rtl:abletoneOptions.rtl ? true : false, autoHeight:true, margin: 0, items: 1, nav: false, dots: true, autoplay: true, autoplayTimeout: 4000, loop: false, }; $(".main-slider").owlCarousel(sliderOptions); // Testimonial Section var testimonialLayout = 1; var testimonialOptions = { rtl:abletoneOptions.rtl ? true : false, autoHeight: true, margin: 0, items: 1, nav: true, dots: false, autoplay: true, autoplayTimeout: 4000, loop: true, responsive:{ 0:{ items:1 }, } }; $( '.testimonial-slider' ).owlCarousel(testimonialOptions); } // Match Height of Featured Content if ( $.isFunction( $.fn.matchHeight ) ) { $('#featured-content-section .entry-container').matchHeight(); } $( function() { // Match Height of Featured Content if ( $.isFunction( $.fn.MatchHeight ) ) { $('#featured-content-section .entry-container').matchHeight(); } // Functionality for scroll to top button $(window).scroll( function () { if ( $( this ).scrollTop() > 100 ) { $( '#scrollup' ).fadeIn('slow'); $( '#scrollup' ).show(); } else { $('#scrollup').fadeOut('slow'); $("#scrollup").hide(); } }); $( '#scrollup' ).on( 'click', function () { $( 'body, html' ).animate({ scrollTop: 0 }, 500 ); return false; }); // Fit Vid load if ( $.isFunction( $.fn.fitVids ) ) { $('.hentry, .widget').fitVids(); } }); //Light Box for videos section if ( jQuery.isFunction( jQuery.fn.flashy ) ) { $('.mixed').flashy({ gallery: false, }); } // Add header video class after the video is loaded. $( document ).on( 'wp-custom-header-video-loaded', function() { $( 'body' ).addClass( 'has-header-video' ); }); /* * Test if inline SVGs are supported. * @link https://github.com/Modernizr/Modernizr/ */ function supportsInlineSVG() { var div = document.createElement( 'div' ); div.innerHTML = ''; return 'http://www.w3.org/2000/svg' === ( 'undefined' !== typeof SVGRect && div.firstChild && div.firstChild.namespaceURI ); } $( function() { $( document ).ready( function() { if ( true === supportsInlineSVG() ) { document.documentElement.className = document.documentElement.className.replace( /(\s*)no-svg(\s*)/, '$1svg$2' ); } }); }); $( '.search-toggle' ).click( function() { $( this ).toggleClass( 'open' ); $( this ).attr( 'aria-expanded', $( this ).attr( 'aria-expanded' ) === 'false' ? 'true' : 'false' ); $( '.search-wrapper' ).toggle(); }); /* Menu */ var body, masthead, menuToggle, siteNavigation, socialNavigation, siteHeaderMenu, resizeTimer; function initMainNavigation( container ) { // Add dropdown toggle that displays child menu items. var dropdownToggle = $( '