/* global adonisScreenReaderText */ /* * Custom scripts * Description: Custom scripts for adonis */ ( function( $ ) { /** * Functionality for scroll to top button */ $( function() { $(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; }); }); // Add header video class after the video is loaded. $( document ).on( 'wp-custom-header-video-loaded', function() { $( 'body' ).addClass( 'has-header-video' ); }); //Scroll Down. $(".button-scroll").on("click", function(e){ e.preventDefault(); var findHeader = $('body').find('.custom-header').next(); var scrollTo = findHeader.offset().top; $('html, body').animate({ scrollTop: scrollTo }, 1000); }); /* * 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' ); } }); }); /* Menu */ var body, masthead, menuToggle, siteNavigation, socialNavigation, siteHeaderMenu, resizeTimer; function initMainNavigation( container ) { // Add dropdown toggle that displays child menu items. var dropdownToggle = $( '