-4
I have the following problem in the code below:
// Muda o menu de imagem pra texto
var x = $(window).width();
if(x >= 590){
$(document).on("scroll",function(){
if($(document).scrollTop()>100){ //QUANDO O SCROLL PASSAR DOS 100px DO TOPO
$("#nav_logo_img").removeClass("imgON").addClass("imgnone");
$("#nav_logo_texto").addClass("logo_textoON").fadeIn();
$("nav").addClass("nav_pequeno").addClass("bg_navbar");
} else{
$("#nav_logo_img").removeClass("imgnone").addClass("imgON");
$("#nav_logo_texto").removeClass("logo_textoON").fadeOut();
$("nav").removeClass("nav_pequeno").removeClass("bg_navbar");
}
});
}else{
// não muda nada
}
This code is so that the navbar when passing 100px decreases in size, and changes the color and logo of the site, this is working 100%. The problem is that in the mobile version the text already appears by default, the more the code above makes the logo blink on the screen, I tried to use an if to change this in the mobile version more not getting you, without someone can give me a light on how to make this effect appear in the desktop version??
bgd, it worked right!
– Lukas Takahashi