Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

220
Views
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
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!