Q: Prevent adding class without browser scroll This js add class only while Scroll Up the browser page. But problem is after Scroll Up browser to top of the page .darkHeader class are not remove, means i want to remove this class after page Scroll Up to top.
JS
lastScroll = 0;
$(window).on('scroll',function() {    
    var scroll = $(window).scrollTop();
    if(lastScroll - scroll > 0) {
        $(".nav").addClass("darkHeader");
    } else {
        $(".nav").removeClass("darkHeader");
    }
    lastScroll = scroll;
});

JSfiddle >>
How to remove .darkHeader class after page has completely scroll Up on top of page/head? How to prevent adding class without browser scrolling?

A: You could add another condition which checks if the scrolling is at the top of the page, and removes the class like this:
    if(scroll === 0){
        $(".nav").removeClass("darkHeader");
    } else if(lastScroll - scroll > 0) {
        $(".nav").addClass("darkHeader");
    } else {
        $(".nav").removeClass("darkHeader");
    }

