Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

121
Visualizações
intersection observer not working when element is half outside viewport

I am using fullpage js for single scroll effect on the page and using intersection observer to detect if the element is inside the viewport to add the animation class. The fadein animation from left and right is used and works on some elements. To do that I have classes as below:

.animate-x {
    opacity: 0;
    transform: translateX(-50%);
    transition: all .5s ease-out;
}

.fl {
    opacity: 1;
    transform: translateX(0);
}

using translateX(-50%) make some elements to set position outside the viewport which does not detected by the Intersection Observer. I suppose this should not have happen since I have used this kind of propertied for animation before.

link to repo: https://github.com/Trushar10/theinstock.git

link to site: https://theinstock.netlify.app/

In section 2 left first element with class description has animate-x class which should have fl class added when the it comes in viewport. on the right side the element with class ````benefitshas classfr``` added to fadein from right animation.

Check out the links if helps.

about 4 years ago · Juan Pablo Isaza
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda