// NAVIGATION CALLBACK jQuery(function($){ "use strict"; jQuery('.main-menu-navigation > ul').superfish({ delay: 500, animation: {opacity:'show',height:'show'}, speed: 'fast' }); }); function campus_education_resMenu_open() { window.campus_education_mobileMenu=true; jQuery(".side-nav").addClass('show'); } function campus_education_resMenu_close() { window.campus_education_mobileMenu=false; jQuery(".side-nav").removeClass('show'); } jQuery(function($){ $(window).scroll(function(){ if ($(window).scrollTop() >= 100) { $('.toggle-menu').addClass('sticky'); } else { $('.toggle-menu').removeClass('sticky'); } }); $(window).scroll(function(){ var sticky = $('.sticky-header'), scroll = $(window).scrollTop(); if (scroll >= 100) sticky.addClass('fixed-header'); else sticky.removeClass('fixed-header'); }); $(window).load(function() { $(".tg-loader").delay(2000).fadeOut("slow"); $("#overlayer").delay(2000).fadeOut("slow"); }); $(window).load(function() { $(".preloader").delay(2000).fadeOut("slow"); $(".preloader .preloader-container").delay(2000).fadeOut("slow"); }); // back to top. $( window ).scroll( function() { if ( $( this ).scrollTop() > 200 ) { $( '.back-to-top' ).addClass( 'show-back-to-top' ); } else { $( '.back-to-top' ).removeClass( 'show-back-to-top' ); } }); $( '.back-to-top' ).click( function() { $( 'html, body' ).animate( { scrollTop : 0 }, 200 ); return false; }); }); jQuery(window).load(function() { window.campus_education_currentfocus=null; campus_education_checkfocusdElement(); var campus_education_body = document.querySelector('body'); campus_education_body.addEventListener('keyup', campus_education_check_tab_press); var campus_education_gotoHome = false; var campus_education_gotoClose = false; window.campus_education_mobileMenu=false; function campus_education_checkfocusdElement(){ if(window.campus_education_currentfocus=document.activeElement.className){ window.campus_education_currentfocus=document.activeElement.className; } } function campus_education_check_tab_press(e) { "use strict"; // pick passed event or global event object if passed one is empty e = e || event; var activeElement; if(window.innerWidth < 999){ if (e.keyCode == 9) { if(window.campus_education_mobileMenu){ if (!e.shiftKey) { if(campus_education_gotoHome) { jQuery( ".main-menu-navigation ul:first li:first a:first-child" ).focus(); } } if (jQuery("a.closebtn.responsive-menu").is(":focus")) { campus_education_gotoHome = true; } else { campus_education_gotoHome = false; } } } } if (e.shiftKey && e.keyCode == 9) { if(window.innerWidth < 999){ if(window.campus_education_currentfocus=="header-search"){ jQuery("button.mobiletoggle").focus(); }else{ if(window.campus_education_mobileMenu){ if(campus_education_gotoClose){ jQuery("a.closebtn.responsive-menu").focus(); } if(jQuery( ".main-menu-navigation ul:first li:first a:first-child" ).is(":focus")) { campus_education_gotoClose = true; } else { campus_education_gotoClose = false; } } } } } campus_education_checkfocusdElement(); } });