//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(); }); //Video header jQuery(function($) { var testMobile; var isMobile = { iOS: function() { return navigator.userAgent.match(/iPhone|iPad|iPod/i); }, }; testMobile = isMobile.iOS(); $(window).on('ready load', function () { $('#wp-custom-header').fitVids(); if (testMobile != null) { $('#wp-custom-header-video-button').css('opacity', '0'); $('#wp-custom-header-video').prop('controls',true); } }); }); //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(""); } }); //Mobile menu 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() }); }); //Preloader jQuery(function($) { var preloader = $('.preloader'); preloader.addClass('preloader-hidden'); setTimeout(function(){preloader.hide();}, 600); }); //Colors jQuery(function($) { var elements = 'h1,h2:not(.widget-title),h3,h4,h5,h6,a,div,span'; $('.page-template-page_widgetized section').each( function() { if ($(this).data('color') == 'inherit') { $(this).find(elements).css('color','inherit'); } }); }); //Flex fallback jQuery(function($) { var doc = document.documentElement.style; if ( !('flexWrap' in doc) && !('WebkitFlexWrap' in doc) && !('msFlexWrap' in doc) ) { function equalColumns() { var multicol = $( '.multicolumn-row' ); if($(window).width() > 991) { multicol.each(function(index, element) { $(element).find('section').each(function() { var column = $('.multicolumn-row section'); var maxHeight = Math.max.apply(null, column.map(function () { return $(this).outerHeight(); }).get()); $(this).outerHeight(maxHeight); }); }); } else { $( '.multicolumn-row section' ).css('height', ''); } } function footerFix() { $('.footer-contact').addClass('footernoFlex'); } $(document).ready(equalColumns); $(window).on('resize',equalColumns); $(document).ready(footerFix); } }); //Anchor scroll jQuery(function($) { $('.main-navigation a[href^="#"], .button[href^="#"]').on('click',function (e) { e.preventDefault(); var target = this.hash; var $target = $(target); $('html, body').stop().animate({ 'scrollTop': $target.offset().top - 100 }, 900); }); var owl = $('.owl-carousel'); $("#testimonial-slider").owlCarousel( { animateOut: 'fadeOut', dots:false, loop:true, autoplay:true, center: true, autoplayTimeout:5000, navText: ["",""], responsiveClass:true, responsive:{ 0:{ items:1, nav:true }, 550:{ items:1, nav:true }, 768:{ items:1, nav:true, loop:true } } }); }); jQuery(function( $ ){ if($('.banneer_wrapper').length > 0){ $('.banneer_wrapper').owlCarousel({ loop:false, margin:10, autoplay: true, responsiveClass:true, autoplayHoverPause:true, responsive:{ 0:{ items:1, }, 600:{ items:1, }, 1000:{ items:1, } } }); } $( '.nav-primary .genesis-nav-menu, .nav-secondary .genesis-nav-menu' ).addClass( 'responsive-menu' ).before(''); $( '.responsive-menu-icon' ).click(function(){ $(this).next( '.nav-primary .genesis-nav-menu, .nav-secondary .genesis-nav-menu' ).slideToggle(); }); $( window ).resize(function(){ if ( window.innerWidth > 800 ) { $( '.nav-primary .genesis-nav-menu, .nav-secondary .genesis-nav-menu, nav .sub-menu' ).removeAttr( 'style' ); $( '.responsive-menu > .menu-item' ).removeClass( 'menu-open' ); } }); $( '.responsive-menu > .menu-item' ).click(function(event){ if ( event.target !== this ) return; $(this).find( '.sub-menu:first' ).slideToggle(function() { $(this).parent().toggleClass( 'menu-open' ); }); }); $('#main-nav-search-link').click(function(){ $('.search-div').show('1200'); }); $(document.body).not("#searchform-1").click(function(event){ // event.stopPropagation(); var el = $(event.target); console.log(el.attr); var gsfrm = $(el).closest('form'); if(el.attr('id') !='main-nav-search-link' && (el.attr('id') !='searchform-1') && el.attr('role') != 'search' && gsfrm.attr('role') != 'search'){ $('.search-div').hide('1200'); } }); }); jQuery(document).ready(function($){ // Scroll (in pixels) after which the "To Top" link is shown var offset = 400, //Scroll (in pixels) after which the "back to top" link opacity is reduced offset_opacity = 1200, //Duration of the top scrolling animation (in ms) scroll_top_duration = 700, //Get the "To Top" link $back_to_top = $('.authorpreneur-backtotop'); //Visible or not "To Top" link $(window).scroll(function(){ ( $(this).scrollTop() > offset ) ? $back_to_top.addClass('top-is-visible') : $back_to_top.removeClass('top-is-visible top-fade-out'); if( $(this).scrollTop() > offset_opacity ) { $back_to_top.addClass('top-fade-out'); } }); //Smoothy scroll to top $back_to_top.on('click', function(event){ event.preventDefault(); $('body,html').animate({ scrollTop: 0 , }, scroll_top_duration ); }); }); (function($) { //* Make sure JS is enabled document.documentElement.className = "js"; $(document).ready( function() { //* Run 0.25 seconds after document ready for any instances viewable on load setTimeout( function() { animateObject(); }, 250); }); $(window).scroll( function() { //* Run on scroll animateObject(); }); function animateObject() { //* Define your object via class var object = $( '.fadeup-effect' ); //* Loop through each object in the array $.each( object, function() { var windowHeight = $(window).height(), offset = $(this).offset().top, top = offset - $(document).scrollTop(), percent = Math.floor( top / windowHeight * 100 ); if ( percent < 80 ) { $(this).addClass( 'fadeInUp' ); } }); } })(jQuery); jQuery(function( $ ){ $(window).scroll(function () { if ($(window).scrollTop() > $(window).height()/2) { $('.adjacent-entry-pagination').fadeIn(); } else { $('.adjacent-entry-pagination').fadeOut(); } }); }); ( function( window, $, undefined ) { 'use strict'; $( 'nav' ).before( '' ); // Add toggles to menus $( 'nav .sub-menu' ).before( '' ); // Add toggles to sub menus // Show/hide the navigation $( '.menu-toggle, .sub-menu-toggle' ).on( 'click', function() { var $this = $( this ); $this.attr( 'aria-pressed', function( index, value ) { return 'false' === value ? 'true' : 'false'; }); $this.toggleClass( 'activated' ); $this.next( 'nav, .sub-menu' ).slideToggle( 'fast' ); }); })( this, jQuery ); function MatchHeight() { jQuery('.extra_pad').matchHeight({}) ; } //Functions that run when all HTML is loaded jQuery(document).ready(function($) { MatchHeight(); });