function edgtfHeaderBehaviour() {
        var header = $('.edgtf-page-header'),
	        stickyHeader = $('.edgtf-sticky-header'),
            fixedHeaderWrapper = $('.edgtf-fixed-wrapper'),
	        fixedMenuArea = fixedHeaderWrapper.children('.edgtf-menu-area'),
	        fixedMenuAreaHeight = fixedMenuArea.outerHeight(),
            sliderHolder = $('.edgtf-slider'),
            revSliderHeight = sliderHolder.length ? sliderHolder.outerHeight() : 0,
	        stickyAppearAmount,
	        headerAppear;
        
        var headerMenuAreaOffset = fixedHeaderWrapper.length ? fixedHeaderWrapper.offset().top - edgtfGlobalVars.vars.edgtfAddForAdminBar : 0;

        switch(true) {
            // sticky header that will be shown when user scrolls up
            case edgtf.body.hasClass('edgtf-sticky-header-on-scroll-up'):
                edgtf.modules.stickyHeader.behaviour = 'edgtf-sticky-header-on-scroll-up';
                var docYScroll1 = $(document).scrollTop();
                stickyAppearAmount = parseInt(edgtfGlobalVars.vars.edgtfTopBarHeight) + parseInt(edgtfGlobalVars.vars.edgtfLogoAreaHeight) + parseInt(edgtfGlobalVars.vars.edgtfMenuAreaHeight) + parseInt(edgtfGlobalVars.vars.edgtfStickyHeaderHeight);
	            
                headerAppear = function(){
                    var docYScroll2 = $(document).scrollTop();
					
                    if((docYScroll2 > docYScroll1 && docYScroll2 > stickyAppearAmount) || (docYScroll2 < stickyAppearAmount)) {
                        edgtf.modules.stickyHeader.isStickyVisible = false;
                        stickyHeader.removeClass('header-appear').find('.edgtf-main-menu .second').removeClass('edgtf-drop-down-start');
                        edgtf.body.removeClass('edgtf-sticky-header-appear');
                    } else {
                        edgtf.modules.stickyHeader.isStickyVisible = true;
                        stickyHeader.addClass('header-appear');
	                    edgtf.body.addClass('edgtf-sticky-header-appear');
                    }

                    docYScroll1 = $(document).scrollTop();
                };
                headerAppear();

                $(window).scroll(function() {
                    headerAppear();
                });

                break;

            // sticky header that will be shown when user scrolls both up and down
            case edgtf.body.hasClass('edgtf-sticky-header-on-scroll-down-up'):
                edgtf.modules.stickyHeader.behaviour = 'edgtf-sticky-header-on-scroll-down-up';

                if(edgtfPerPageVars.vars.edgtfStickyScrollAmount !== 0){
                    edgtf.modules.stickyHeader.stickyAppearAmount = parseInt(edgtfPerPageVars.vars.edgtfStickyScrollAmount);
                } else {
                    edgtf.modules.stickyHeader.stickyAppearAmount = parseInt(edgtfGlobalVars.vars.edgtfTopBarHeight) + parseInt(edgtfGlobalVars.vars.edgtfLogoAreaHeight) + parseInt(edgtfGlobalVars.vars.edgtfMenuAreaHeight) + parseInt(revSliderHeight);
                }

                headerAppear = function(){
                    if(edgtf.scroll < edgtf.modules.stickyHeader.stickyAppearAmount) {
                        edgtf.modules.stickyHeader.isStickyVisible = false;
                        stickyHeader.removeClass('header-appear').find('.edgtf-main-menu .second').removeClass('edgtf-drop-down-start');
	                    edgtf.body.removeClass('edgtf-sticky-header-appear');
                    }else{
                        edgtf.modules.stickyHeader.isStickyVisible = true;
                        stickyHeader.addClass('header-appear');
	                    edgtf.body.addClass('edgtf-sticky-header-appear');
                    }
                };

                headerAppear();

                $(window).scroll(function() {
                    headerAppear();
                });

                break;

            // on scroll down, part of header will be sticky
            case edgtf.body.hasClass('edgtf-fixed-on-scroll'):
                edgtf.modules.stickyHeader.behaviour = 'edgtf-fixed-on-scroll';
                var headerFixed = function(){
	
	                if(edgtf.scroll <= headerMenuAreaOffset) {
		                fixedHeaderWrapper.removeClass('fixed');
		                edgtf.body.removeClass('edgtf-fixed-header-appear');
		                header.css('margin-bottom', '0');
	                } else {
		                fixedHeaderWrapper.addClass('fixed');
		                edgtf.body.addClass('edgtf-fixed-header-appear');
		                header.css('margin-bottom', fixedMenuAreaHeight + 'px');
	                }
                };

                headerFixed();

                $(window).scroll(function() {
                    headerFixed();
                });

                break;
        }
    }
/*
     **	Show/Hide sticky header on window scroll
     */
Show/Hide sticky header on window scroll
Show / Hide sticky header on window scroll
function edgtfHeaderBehaviour() {
        var header = $('.edgtf-page-header'),
	        stickyHeader = $('.edgtf-sticky-header'),
            fixedHeaderWrapper = $('.edgtf-fixed-wrapper'),
	        fixedMenuArea = fixedHeaderWrapper.children('.edgtf-menu-area'),
	        fixedMenuAreaHeight = fixedMenuArea.outerHeight(),
            sliderHolder = $('.edgtf-slider'),
            revSliderHeight = sliderHolder.length ? sliderHolder.outerHeight() : 0,
	        stickyAppearAmount,
	        headerAppear;
        var headerMenuAreaOffset = fixedHeaderWrapper.length ? fixedHeaderWrapper.offset().top - edgtfGlobalVars.vars.edgtfAddForAdminBar : 0;
        switch(true) {
            case edgtf.body.hasClass('edgtf-sticky-header-on-scroll-up'):
                edgtf.modules.stickyHeader.behaviour = 'edgtf-sticky-header-on-scroll-up';
                var docYScroll1 = $(document).scrollTop();
                stickyAppearAmount = parseInt(edgtfGlobalVars.vars.edgtfTopBarHeight) + parseInt(edgtfGlobalVars.vars.edgtfLogoAreaHeight) + parseInt(edgtfGlobalVars.vars.edgtfMenuAreaHeight) + parseInt(edgtfGlobalVars.vars.edgtfStickyHeaderHeight);
                headerAppear = function(){
                    var docYScroll2 = $(document).scrollTop();
                    if((docYScroll2 > docYScroll1 && docYScroll2 > stickyAppearAmount) || (docYScroll2 < stickyAppearAmount)) {
                        edgtf.modules.stickyHeader.isStickyVisible = false;
                        stickyHeader.removeClass('header-appear').find('.edgtf-main-menu .second').removeClass('edgtf-drop-down-start');
                        edgtf.body.removeClass('edgtf-sticky-header-appear');
                    } else {
                        edgtf.modules.stickyHeader.isStickyVisible = true;
                        stickyHeader.addClass('header-appear');
	                    edgtf.body.addClass('edgtf-sticky-header-appear');
                    }
                    docYScroll1 = $(document).scrollTop();
                };
                headerAppear();
                $(window).scroll(function() {
                    headerAppear();
                });
                break;
            case edgtf.body.hasClass('edgtf-sticky-header-on-scroll-down-up'):
                edgtf.modules.stickyHeader.behaviour = 'edgtf-sticky-header-on-scroll-down-up';
                if(edgtfPerPageVars.vars.edgtfStickyScrollAmount !== 0){
                    edgtf.modules.stickyHeader.stickyAppearAmount = parseInt(edgtfPerPageVars.vars.edgtfStickyScrollAmount);
                } else {
                    edgtf.modules.stickyHeader.stickyAppearAmount = parseInt(edgtfGlobalVars.vars.edgtfTopBarHeight) + parseInt(edgtfGlobalVars.vars.edgtfLogoAreaHeight) + parseInt(edgtfGlobalVars.vars.edgtfMenuAreaHeight) + parseInt(revSliderHeight);
                }
                headerAppear = function(){
                    if(edgtf.scroll < edgtf.modules.stickyHeader.stickyAppearAmount) {
                        edgtf.modules.stickyHeader.isStickyVisible = false;
                        stickyHeader.removeClass('header-appear').find('.edgtf-main-menu .second').removeClass('edgtf-drop-down-start');
	                    edgtf.body.removeClass('edgtf-sticky-header-appear');
                    }else{
                        edgtf.modules.stickyHeader.isStickyVisible = true;
                        stickyHeader.addClass('header-appear');
	                    edgtf.body.addClass('edgtf-sticky-header-appear');
                    }
                };
                headerAppear();
                $(window).scroll(function() {
                    headerAppear();
                });
                break;
            case edgtf.body.hasClass('edgtf-fixed-on-scroll'):
                edgtf.modules.stickyHeader.behaviour = 'edgtf-fixed-on-scroll';
                var headerFixed = function(){
	                if(edgtf.scroll <= headerMenuAreaOffset) {
		                fixedHeaderWrapper.removeClass('fixed');
		                edgtf.body.removeClass('edgtf-fixed-header-appear');
		                header.css('margin-bottom', '0');
	                } else {
		                fixedHeaderWrapper.addClass('fixed');
		                edgtf.body.addClass('edgtf-fixed-header-appear');
		                header.css('margin-bottom', fixedMenuAreaHeight + 'px');
	                }
                };
                headerFixed();
                $(window).scroll(function() {
                    headerFixed();
                });
                break;
        }
    }
function edgtfHeaderBehaviour ( ) { var header = $ ( '.edgtf-page-header' ) , stickyHeader = $ ( '.edgtf-sticky-header' ) , fixedHeaderWrapper = $ ( '.edgtf-fixed-wrapper' ) , fixedMenuArea = fixedHeaderWrapper . children ( '.edgtf-menu-area' ) , fixedMenuAreaHeight = fixedMenuArea . outerHeight ( ) , sliderHolder = $ ( '.edgtf-slider' ) , revSliderHeight = sliderHolder . length ? sliderHolder . outerHeight ( ) : 0 , stickyAppearAmount , headerAppear ; var headerMenuAreaOffset = fixedHeaderWrapper . length ? fixedHeaderWrapper . offset ( ) . top - edgtfGlobalVars . vars . edgtfAddForAdminBar : 0 ; switch ( true ) { case edgtf . body . hasClass ( 'edgtf-sticky-header-on-scroll-up' ) : edgtf . modules . stickyHeader . behaviour = 'edgtf-sticky-header-on-scroll-up' ; var docYScroll1 = $ ( document ) . scrollTop ( ) ; stickyAppearAmount = parseInt ( edgtfGlobalVars . vars . edgtfTopBarHeight ) + parseInt ( edgtfGlobalVars . vars . edgtfLogoAreaHeight ) + parseInt ( edgtfGlobalVars . vars . edgtfMenuAreaHeight ) + parseInt ( edgtfGlobalVars . vars . edgtfStickyHeaderHeight ) ; headerAppear = function ( ) { var docYScroll2 = $ ( document ) . scrollTop ( ) ; if ( ( docYScroll2 > docYScroll1 && docYScroll2 > stickyAppearAmount ) || ( docYScroll2 < stickyAppearAmount ) ) { edgtf . modules . stickyHeader . isStickyVisible = false ; stickyHeader . removeClass ( 'header-appear' ) . find ( '.edgtf-main-menu .second' ) . removeClass ( 'edgtf-drop-down-start' ) ; edgtf . body . removeClass ( 'edgtf-sticky-header-appear' ) ; } else { edgtf . modules . stickyHeader . isStickyVisible = true ; stickyHeader . addClass ( 'header-appear' ) ; edgtf . body . addClass ( 'edgtf-sticky-header-appear' ) ; } docYScroll1 = $ ( document ) . scrollTop ( ) ; } ; headerAppear ( ) ; $ ( window ) . scroll ( function ( ) { headerAppear ( ) ; } ) ; break ; case edgtf . body . hasClass ( 'edgtf-sticky-header-on-scroll-down-up' ) : edgtf . modules . stickyHeader . behaviour = 'edgtf-sticky-header-on-scroll-down-up' ; if ( edgtfPerPageVars . vars . edgtfStickyScrollAmount !== 0 ) { edgtf . modules . stickyHeader . stickyAppearAmount = parseInt ( edgtfPerPageVars . vars . edgtfStickyScrollAmount ) ; } else { edgtf . modules . stickyHeader . stickyAppearAmount = parseInt ( edgtfGlobalVars . vars . edgtfTopBarHeight ) + parseInt ( edgtfGlobalVars . vars . edgtfLogoAreaHeight ) + parseInt ( edgtfGlobalVars . vars . edgtfMenuAreaHeight ) + parseInt ( revSliderHeight ) ; } headerAppear = function ( ) { if ( edgtf . scroll < edgtf . modules . stickyHeader . stickyAppearAmount ) { edgtf . modules . stickyHeader . isStickyVisible = false ; stickyHeader . removeClass ( 'header-appear' ) . find ( '.edgtf-main-menu .second' ) . removeClass ( 'edgtf-drop-down-start' ) ; edgtf . body . removeClass ( 'edgtf-sticky-header-appear' ) ; } else { edgtf . modules . stickyHeader . isStickyVisible = true ; stickyHeader . addClass ( 'header-appear' ) ; edgtf . body . addClass ( 'edgtf-sticky-header-appear' ) ; } } ; headerAppear ( ) ; $ ( window ) . scroll ( function ( ) { headerAppear ( ) ; } ) ; break ; case edgtf . body . hasClass ( 'edgtf-fixed-on-scroll' ) : edgtf . modules . stickyHeader . behaviour = 'edgtf-fixed-on-scroll' ; var headerFixed = function ( ) { if ( edgtf . scroll <= headerMenuAreaOffset ) { fixedHeaderWrapper . removeClass ( 'fixed' ) ; edgtf . body . removeClass ( 'edgtf-fixed-header-appear' ) ; header . css ( 'margin-bottom' , '0' ) ; } else { fixedHeaderWrapper . addClass ( 'fixed' ) ; edgtf . body . addClass ( 'edgtf-fixed-header-appear' ) ; header . css ( 'margin-bottom' , fixedMenuAreaHeight + 'px' ) ; } } ; headerFixed ( ) ; $ ( window ) . scroll ( function ( ) { headerFixed ( ) ; } ) ; break ; } }
Show/Hide sticky header on window scroll
Show / Hide sticky header on window scroll
// sticky header that will be shown when user scrolls up // sticky header that will be shown when user scrolls both up and down // on scroll down, part of header will be sticky