N
N
nikober2018-07-14 01:48:08
css
nikober, 2018-07-14 01:48:08

How can I make the menu disappear when scrolling?

How can I make the menu pinned to the top disappear when scrolling down (at the anchor), and appear when scrolling up again (above the anchor)?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
L
ljutaev, 2018-07-14
@nikober

$(window).bind('scroll', function () {
        if ($(window).scrollTop() > 50) {
            $('.fixed-scroll').addClass('scrolled');
        } else {
            $('.fixed-scroll').removeClass('scrolled');
        }
    });

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question