Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

101
Vistas
Jquery IMG Attr change keeps flickering while scrolling

I have a white menu icon in PNG format that I want to change to green menu icon in PNG format and I tried to use the fading effect. It works at first and changes on scroll but when I keep scrolling it keeps flickering the green icon, however it stops when I stop scrolling as well. I'm not sure why this is happening or how can I fix it, couldn't really find the related questions. I'd appreciate your help. Thanks in advance here is my code:

      $(window).scroll(function() {
          var scroll = $(window).scrollTop();

          if (scroll >= 50) {
            $(".show_nav img").fadeOut(function() {
              $(this).attr("src","../img/icons/menu-green.png").fadeIn();
            });

          } else {
            $(".show_nav img").fadeOut(function() {
              $(this).attr("src","../img/icons/menu-white.png").fadeIn();
            });
          }
      });
about 4 years ago · Juan Pablo Isaza
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda