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

204
Views
Adding delay to a scrolling function, more or less allowing it to be less of an instant scroll to a certain position

So, I've got this request and.. Basically I want the scrolling mechanism to be less instant and more of the speed it would be if I naturally scrolled to said position.

Script:

(function() {
    'use strict';
    var SoreHolder = document.getElementById('storeHolder');
    SoreHolder.scrollTop = 0;
    document.addEventListener('keydown', function(e) {
        if (e.keyCode === 90) { // y
            SoreHolder.scrollTop = 1200;
        };
        if (e.keyCode === 67) { // z
            SoreHolder.scrollTop = 2200;
        };
        if (e.keyCode === 72) { // c
            SoreHolder.scrollTop = 1800;
        };
        if (e.keyCode === 84) { // v
            SoreHolder.scrollTop = 1400;
        };
    })
})();

Anyway, if you can offer any help I'd greatly appreciate it. 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!