D
D
Dantes5892020-04-29 22:21:00
JavaScript
Dantes589, 2020-04-29 22:21:00

How to start from the step where you left off in the input range?

Good evening, tell me the algorithm for saving a step in the input range, so that when we move again, we take into account the previous step.
In my example, if you move the mouse up or down along the height of the block, the step in the input range changes and the scaling factor is calculated in the range from 1 to 3.
The formula is not exact, but in my project it works correctly, here in the example I hardcoded, so don't go too deep.

It is necessary that if you move the mouse repeatedly, the countdown starts from the place where we originally stopped. Now it twitches and starts from the place where we clicked. Thank you!
https://codepen.io/FillPower/pen/oNjeGod
You need to move the mouse over the red square)

Answer the question

In order to leave comments, you need to log in

1 answer(s)
R
real2210, 2020-04-29
@real2210

Save the position in Local storage
Well, save the position when changing locally

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question