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

229
Views
What is the problem in here? it is not working in chrome
Window.onscroll = () => {
                    if (Window.innerHeight + Window.scrolly >= document.body.offsetHeight) {
                        document.querySelector('body').style.background = 'green';
                    } else {
                        document.querySelector('body').style.background = 'white';
                    }
                }

I am new at coding, learning from an online course. Now I am stuck at it. i don't know what is wrong in here

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

As was mentioned in the comment you got wrong letter cases: window, scrollY

const body = document.querySelector('body');
body.style.height = '200vh'; // without content there's no scroll, so this will produce scroll;
window.onscroll = () => {
  if (window.innerHeight + window.scrollY >= document.body.offsetHeight) {
    body.style.background = 'green';
  } else {
    body.style.background = 'white';
  }
}

about 4 years ago · Juan Pablo Isaza Report
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!