V
V
Viorel2017-03-28 20:17:51
css
Viorel, 2017-03-28 20:17:51

How to remove the line on page reload?

Hi all!

i hide the menu using jquery
0f46acc9de1a414a9e6303bc29de85c0.png

$(document).ready(function(){
    
    // hide .navbar first
    $(".myfixed").hide();
    
    
    $(function () {
        $(window).scroll(function () {
           
            if ($(this).scrollTop() > 270) {
                $('.myfixed').fadeIn();
            } else {
                $('.myfixed').fadeOut();
            }
        });

    
    });

});


and when scrolling to the bottom it appears,
41c15beec7134e1dab30e9863921171d.png

but when the page is reloaded, the menu line appears how to remove it?

0dc5eeab4fd34d9c9d041a25de5499eb.png

Answer the question

In order to leave comments, you need to log in

1 answer(s)
R
Ruslan Polin, 2017-03-28
@bushido2014

This is due to the fact that your script does not have time to load and hide the block. I will repeat what I said in the comment. Maybe put display:none instead of hiding it with jquery?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question