M
M
mahbe2015-01-22 18:11:26
JavaScript
mahbe, 2015-01-22 18:11:26

How to make custom accompanying menu for jQuery landing page?

Please help me fix a bug in the menu on mrcanario.com
If you scroll very quickly from the bottom up, the menu does not have time to appear :(

Code:

jQuery(window).scroll(function () {
        var top = jQuery(this).scrollTop();
        var menu = jQuery('#header-text-nav-container');
        if (top < 200) {
            menu.stop().css('top', '0px');
        }
        if (top > 201 && top < 300) {
            menu.css('top' , '-70px');
            menu.css('position', 'absolute');
        }
        if (top >= 570 ) {
            menu.css('position', 'fixed');
            if (menu.css('top') == '-70px') {
                menu.stop().animate({
                    top: 0
                }, 200);
            }
        }
        if (top < 570){
            if (menu.css('top') == '0px' && menu.css('position') == 'fixed') {
                menu.stop().animate({
                    top: -70
                }, 200);
            }
        }


Thanks in advance!

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question