1
I want to get the menu fixed after certain scrolling,
<script>
$("document").ready(function($){
var nav = $('.menu-topo');
$(window).scroll(function () {
if ($(this).scrollTop() > 150) {
nav.addClass("fixo");
} else {
nav.removeClass("fixo");
}
});
});
</script>
and html
<div id="menu-topo">asdasdasd</div>
It’s not getting fixed. What’s wrong?
Possible duplicate of fixed menu with jquery on certain scrolling (scroll) of the page
– Caique Romero