//Menu dropdown animation jQuery(function($) { $('.sub-menu').hide(); $('.main-navigation .children').hide(); if ( matchMedia( 'only screen and (min-width: 1024px)' ).matches ) { $('.menu-item').hover( function() { $(this).children('.sub-menu').fadeIn().addClass('submenu-visible'); }, function() { $(this).children('.sub-menu').fadeOut().removeClass('submenu-visible'); } ); $('.main-navigation li').hover( function() { $(this).children('.main-navigation .children').fadeIn().addClass('submenu-visible'); }, function() { $(this).children('.main-navigation .children').fadeOut().removeClass('submenu-visible'); } ); } }); //Open social links in a new tab jQuery(function($) { $( '.social-menu-widget li a' ).attr( 'target','_blank' ); }); //Fit Vids jQuery(function($) { $("body").fitVids(); }); //Menu bar jQuery(function($) { var headerHeight = $('.site-header').outerHeight(); $('.header-clone').css('height',headerHeight); $(window).resize(function(){ var headerHeight = $('.site-header').outerHeight(); $('.header-clone').css('height',headerHeight); }); }); //Menu bar jQuery(function($) { var header = $('.site-header'); $(window).scroll(function() { if ( $(this).scrollTop() > 0 ) { header.addClass('header-scrolled'); } else { header.removeClass('header-scrolled'); } }); }); //Header text effects jQuery(function($) { var fadeStart = 100; var fadeUntil = 400; var fading = $('.header-info'); $(window).bind('scroll', function(){ var offset = $(document).scrollTop() var opacity = 0; if( offset <= fadeStart ){ opacity = 1; } else if( offset <= fadeUntil ){ opacity = 1-offset/fadeUntil; } fading.css('opacity',opacity); }); }); //Go to top jQuery(function($) { var goTop = $('.go-top'); $(window).scroll(function() { if ( $(this).scrollTop() > 800 ) { goTop.addClass('show'); } else { goTop.removeClass('show'); } }); goTop.on('click', function() { $("html, body").animate({ scrollTop: 0 }, 1000); return false; }); }); //Multicolumn support jQuery(function($) { var twoCols = $(".page-template-page_widgetized section.at-2-col"); for(var i = 0; i < twoCols.length; i+=2) { twoCols.slice(i, i+2).wrapAll("
"); } var threeCols = $(".page-template-page_widgetized section.at-3-col"); for(var i = 0; i < threeCols.length; i+=3) { threeCols.slice(i, i+3).wrapAll("
"); } }); jQuery(function($) { var menuType = 'desktop'; $(window).on('load resize', function() { var currMenuType = 'desktop'; if ( matchMedia( 'only screen and (max-width: 1024px)' ).matches ) { currMenuType = 'mobile'; } if ( currMenuType !== menuType ) { menuType = currMenuType; if ( currMenuType === 'mobile' ) { var $mobileMenu = $('#mainnav').attr('id', 'mainnav-mobi').hide(); var hasChildMenu = $('#mainnav-mobi').find('li:has(ul)'); hasChildMenu.children('ul').hide(); hasChildMenu.children('a').after(''); $('.btn-menu .fa').removeClass('active'); } else { var $desktopMenu = $('#mainnav-mobi').attr('id', 'mainnav').removeAttr('style'); $desktopMenu.find('.submenu').removeAttr('style'); $('.btn-submenu').remove(); } } }); $('.btn-menu .fa').on('click', function() { $('#mainnav-mobi').slideToggle(300); $(this).toggleClass('active'); }); $(document).on('click', '#mainnav-mobi li .btn-submenu', function(e) { $(this).toggleClass('active').next('ul').slideToggle(300); e.stopImmediatePropagation() }); }); //Progress bars jQuery(function($) { $(window).scroll(function() { $('.skill .progress-bar').each( function () { var isVisible = $(this).visible(); var progressWidth = $(this).attr('data-percent'); if (isVisible) { $(this).children().addClass('progress-visible'); $(this).children().css('width', progressWidth + '%'); } else { return false; } } ); }); });