1var FixedHeader = {}, 2 themifyScript = {}; 3 4// JQUERY FUNCTIONS 5(function($){ 6 7 // Fixed Header ///////////////////////// 8 FixedHeader = { 9 headerHeight: 0, 10 init: function() { 11 if( '' !== themifyScript.fixedHeader ) { 12 this.headerHeight = $('#headerwrap').outerHeight(true); 13 this.activate(); 14 $(window).on('scroll touchstart.touchScroll touchmove.touchScroll', this.activate); 15 } 16 $('#pagewrap').css('paddingTop', Math.floor( this.headerHeight )); 17 $(window).on( 'throttledresize', function() { 18 $('#pagewrap').css('paddingTop', Math.floor( $('#headerwrap').outerHeight(true) )); 19 }); 20 }, 21 activate: function() { 22 var $window = $(window), 23 scrollTop = $window.scrollTop(), 24 $headerWrap = $('#headerwrap'); 25 $('#pagewrap').css('paddingTop', Math.floor( this.headerHeight )); 26 if( scrollTop >= FixedHeader.headerHeight ) { 27 if ( ! $headerWrap.hasClass( 'fixed-header' ) ) { 28 FixedHeader.scrollEnabled(); 29 } 30 } else { 31 if ( $headerWrap.hasClass( 'fixed-header' ) ) { 32 FixedHeader.scrollDisabled(); 33 } 34 } 35 }, 36 scrollDisabled: function() { 37 $('#pagewrap').css('paddingTop', Math.floor( this.headerHeight )); 38 $('#headerwrap').removeClass('fixed-header'); 39 $('#header').removeClass('header-on-scroll'); 40 $('body').removeClass('fixed-header-on'); 41 }, 42 scrollEnabled: function() { 43 $('#headerwrap').addClass('fixed-header'); 44 $('#header').addClass('header-on-scroll'); 45 $('body').addClass('fixed-header-on'); 46 } 47 }; 48 49 50 // DOCUMENT READY 51 jQuery(document).ready(function($){ 52 FixedHeader.init(); 53 var $body = $('body'); 54 55 ///////////////////////////////////////////// 56 // Scroll to top 57 ///////////////////////////////////////////// 58 $('.back-top a').click(function () { 59 $('body,html').animate({ 60 scrollTop: 0 61 }, 800); 62 return false; 63 }); 64 65 ///////////////////////////////////////////// 66 // Toggle main nav on mobile 67 ///////////////////////////////////////////// 68 // touch dropdown menu 69 if( typeof jQuery.fn.themifyDropdown === 'function' ) { 70 $( '#main-nav' ).themifyDropdown(); 71 } 72 73 $('#menu-icon').themifySideMenu({ 74 close: '#menu-icon-close', 75 side: 'left' 76 }); 77
78 var $overlay = $( '<div class="body-overlay">' ); 79 $body.append( $overlay ).on( 'sidemenushow.themify', function () { 80 $overlay.addClass( 'body-overlay-on' ); 81 }).on( 'sidemenuhide.themify', function () { 82 $overlay.removeClass( 'body-overlay-on' ); 83 }).on( 'click.themify touchend.themify', '.body-overlay', function () { 84 $( '#menu-icon' ).themifySideMenu( 'hide' ); 85 }); 86 87 $(window).resize(function(){ 88 if( $( '#menu-icon' ).is(':visible') && $('#mobile-menu').hasClass('sidemenu-on')){ 89 $overlay.addClass( 'body-overlay-on' ); 90 } 91 else{ 92 $overlay.removeClass( 'body-overlay-on' ); 93 } 94 }); 95 96 // Reset slide nav width 97 $(window).resize(function(){ 98 var viewport = $(window).width(); 99 if (viewport > 780) { 100 $('body').removeAttr('style'); 101 } 102 }); 103 104 }); 105 106 // WINDOW LOAD 107 jQuery(window).load(function(){ 108 109 // EDGE MENU // 110 jQuery(function ($) { 111 $("#main-nav li").on('mouseenter mouseleave dropdown_open', function (e) { 112 if ($('ul', this).length) { 113 var elm = $('ul:first', this); 114 var off = elm.offset(); 115 var l = off.left; 116 var w = elm.width(); 117 var docW = $(window).width(); 118 var isEntirelyVisible = (l + w <= docW); 119 120 if (!isEntirelyVisible) { 121 $(this).addClass('edge'); 122 } else { 123 $(this).removeClass('edge'); 124 } 125 126 } 127 }); 128 }); 129 130 }); 131 132})(jQuery);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.