Jquery addClass applies but does not give me the result

0

Good morning, I'm having a problem, I'm trying to make an effect for my menu, when the user changes from 200 in scroll the menu increases using height: 85px; , when scrolling it removes the class I created for I'm not sure how to do this, but I'm not sure how to do this, but I'm not sure how to do this. if it would be to increase the height: 85px; of the menu, I am using the sass will it be that this is causing me problem? follow the code below:

movimenta.js:

$(function () {
    $('header').show();
    $(window).scroll(function () {
        if ($(this).scrollTop() > 200) {
            $('header').addClass('header-efeito');
        } else {
            $('header').removeClass('header-efeito');
        }
    });
});

_header.scss:

    .header-efeito {
        header {
            max-height: none;
            height: 130px;
        }
    }


/* voltar como estava */
.main {
    header{
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        z-index: 10;
        max-height: 85px;
        overflow: hidden;
        background: $white;
    }
}

Someone could help me ... Thanks

    
asked by anonymous 02.02.2017 / 12:58

1 answer

0

Stack folks can solve the problem ...

I was declaring the class and the header being that I did not need

Wrong code:

.header-efeito {
      header{
        height: 130px !important;
   }
}

Right code:

.header-efeito {

        height: 130px !important;
}
    
02.02.2017 / 13:10