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

117
Views
How to run css transition using javascript when element is in the middle of the screen

I'm currently making my website more mobile-friendly, but :hover doesn't work on mobile. I have buttons and other elements with hover transition effects so I thought the next best solution would be running the effect when the element is in the middle of the user's screen, like how on the youtube app it will start playing the beginning of a video if it is in the middle of your screen. How do I use Javascript to detect when an element is vertically in the middle of a user's screen, let's say somewhere in the range of 300px to 600px, and to apply a css transition, like changing the color from white to red over 1 second?

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!