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

222
Visualizações
opacity scroll animation but reversed (Javascript)

I have a scroll animation for the clouds but the animation should be reversed. How its working now is that it dissapears when its all the way scrolled up but it needs to be the other way around. www.wytsepunter.com (also its very laggy on phone any tips for making that smoother?)

Here is the code:

let bg = document.getElementById('bg');
    let moon = document.getElementById('moon');
    let rock = document.getElementById('rock');
    let clouds = document.getElementById('clouds');
    let text = document.getElementById('text');

    window.addEventListener('scroll', function (){
        var value = window.scrollY;

        bg.style.top = value + 0.5 + 'px';
        moon.style.left = value * 0.5 + 'px';
        clouds.style.top = value * 0.5 + 'px';
        clouds.style.opacity = value * 0.5 + '%';
        text.style.top = value * 1 + 'px';
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