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

88
Vistas
Elements are not fading in when i scroll down the website. But it is working when i refresh the page

The elements are fading in only when i refresh the page. But i want them to fade-in when scroll down the page.

Here is my JS.

   ```   
          const service =document.querySelector('.service-intro');
         const observer=new IntersectionObserver(entries =>{
         entries.forEach(entry=>{
         if(entry.isIntersecting){
          document.querySelectorAll(".slide-in")[0].classList.add("from-left");
           document.querySelectorAll(".slide-in")[1].classList.add("from-right");
  
          }
          })
          })
          observer.observe(service);```

       ** Here is my CSS code please help me out i have tried many 
           things still not working**


    

```
       #services{
          font-family: 'Libre Baskerville', serif;
       }
     .columns img{
         width: 50%;
         height: 50%;
         box-shadow: 10px 10px 4px rgb(51, 46, 46);
      }

     #h-secondary{ 
          text-align: center;
      }
     .service-intro{
           display: flex;
           gap: 0px;
       }

     .slide-in{
          width: 200px;
          height: 200px;
          background-size: cover;
      }

     .from-left{
            float: left;
            -webkit-animation: from-left 2s ease-in;
        }
     @-webkit-keyframes from-left{
         0%{
             opacity: 0;
             -webkit-transform: translateX(-50px);
           }
         55%{
             opacity: 0.6;
             -webkit-transform: translateX(-25px);
            }
         100%{
             opacity: 1;
             -webkit-transform: translateX(0);
            }
        }

      .from-right{
            -webkit-animation: from-right 2s ease-in;
             float: right;  
         }
        @-webkit-keyframes from-right{
              0%{
                 opacity: 0;
                 -webkit-transform: translateX(50px);
                }
            100%{
                opacity: 1;
                -webkit-transform: translateX(0);
               }
            }```

When i scroll down the Elements(images and texts) are already there they don not fade in when i scrll down but when i refresh the page while my cursor is on that section only then i can see the elements fade_in There is lot of space between the elements also.

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