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

141
Views
Calculate css path using javascript

Given three locations shown in the image below as an example.

enter image description here

With x1 being the starting point, x2 being the mid point, and x3 being the end point.

x1 will be any random location along the bottom edge.

x2 will always be the center of the element.

x3 will be any random location along the top edge.

The idea is to create a path from x1 to x2 then to x3, following a path that goes up, then curves at an angle to the left or right(depending on the starting location), then when it gets close to x2 it curves up towards that point, then following a similar pattern, the same to x3.

Edit for more info

When the onwheel event is trigger, I will determine if it's up or down. Given that information, the element should move from its starting point (x1) to the midpoint (x2) then to its end point (x3) based on the path calculated.

Sorry that I have no code to show for this, I have no idea where to begin on how to calculate a path.

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!