Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8143361
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T13:06:13+00:00 2026-06-06T13:06:13+00:00

I have this event listener: input_1.addEventListener(‘input’,function(){ updateFromInput(1); },false); It controls the location of a

  • 0

I have this event listener:

input_1.addEventListener('input',function(){
    updateFromInput(1);
},false);

It controls the location of a slider.
Right now, if I want to type “100” into the input, the slider will start by jumping to the “1” position, then jump to “10”, then finally jump to the “100” position.
It’s pretty clunky, and I’d like to give it a more natural feel.

While I’m now pretty comfortable reading JS, I’m still quite the novice in writing it.

I understand the logic needed for this type of timer (if timer is greater than 750ms updateFromInput), I’m just a bit hazy how to start coding that in javascript.
Certainly this type of timer functionality has been done a million and one times before by just as many developers … just struggling to find an example or two 🙂

Any code, links, or examples would be greatly appreciated.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-06T13:06:15+00:00Added an answer on June 6, 2026 at 1:06 pm

    The usual way would be to set a timer, and if you see another keystroke, cancel the previous timer and set a new one, e.g.:

    var timer = 0;
    input_1.addEventListener('input',function(){
        maybeUpdateFromInput(1);
    },false);
    
    function maybeUpdateFromInput(val) {
        if (timer) {
            clearTimeout(timer);
        }
        timer = setTimeout(function() {
            updateFromInput(val);
            timer = 0;
        }, 50); // 50 = 50ms, you may want 75, 100, even 125
    }
    

    That will delay the update by 50ms (the value on the setTimeout call). If it doesn’t see input for more than 50ms, it will then update.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have this form submit code: Event.observe(window, 'load', init, false); function init() { Event.observe('addressForm',
I have a input tag with an onblur event listener: <input id=myField type=input onblur=doSomething(this)
I have this: function change( event, file ) { console.log( filename, file ); //It
I have this code which is called at an onChange event of an function
Imagine I have this code: var myFunc1 = function(event) { alert(1); } var myFunc2
I have this code : class Event{}; class CustomEvent:public Event{}; class Handler { public:
I'm building a music events website and want to have a 'share this event'
I have this code for an event handler: rbM.setOnCheckedChangeListener(new OnCheckedChangeListener() { public void onCheckedChanged(CompoundButton
I have a string like this: event name|event description|event type|event date|event time|event details, event
I have this code in a xaml file now in a event handler code

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.