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 in the 100px size decreases, and change the color and logo of the site, it is running 100%. The problem is that in the mobile version the text already appears by default, plus the code above causes the logo to flash on the screen, I tried to use an if to change this in the mobile version but not to achieve, without someone being able to give me a light on how to make this effect appear in the desktop version ??