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

135
Views
Draw svg line on scroll from section

I have a svg file on my website that drows in scroll, but I would like the animation start from particular section, can you help me please ?

Code JS :

$(document).ready(function() {

  var myline = document.getElementById("myline");
  var length = myline.getTotalLength();
  myline.style.strokeDasharray = length;
  
  myline.style.strokeDashoffset = length;
  
  window.addEventListener("scroll", myFunction);
  
  function myFunction() {
    var scrollpercent = (document.body.scrollTop + document.documentElement.scrollTop) / (document.documentElement.scrollHeight - document.documentElement.clientHeight);
    var draw = length * scrollpercent;
  
    myline.style.strokeDashoffset = length - draw;
  
    endPoint = myline.getPointAtLength(draw);
  
  }


});

Thank you !

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!