All Downloads are FREE. Search and download functionalities are using the official Maven repository.

gwt.material.design.addins.client.waterfall.resources.js.waterfall.js Maven / Gradle / Ivy

There is a newer version: 2.8.3
Show newest version
function initWaterfall(height, showCallback, hideCallback, offset) {
    $('nav').pushpin({ top: height });
    $('nav').addClass('z-depth-0');

    var callbacks = $.Callbacks();
    var show;
    function stickyScroll(e) {

        if( window.pageYOffset > offset) {
            if (show !== true) {
                $('nav').removeClass('z-depth-0');
                $('nav').addClass('z-depth-1');
                show = true;
            }
        }else{
            if (show === true) {
                $('nav').removeClass('z-depth-1');
                $('nav').addClass('z-depth-0');
                show = false;
            }
        }

        if( window.pageYOffset > 1) {
            callbacks.add(hideCallback);
            callbacks.fire();

        }else{
            callbacks.add(showCallback);
            callbacks.fire();
        }
    }

    window.addEventListener('scroll', stickyScroll, false);
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy