F
F
fajjet2015-09-25 12:30:43
css
fajjet, 2015-09-25 12:30:43

How to stop the transition animation in a slider?

Let's say we have a mobile slider. When the user touches more than half the width of the block, or swipes very quickly, the slide automatically adjusts the triplet so that the block is completely within the scope. That is, it receives translate and transition during the touchend event. How can you stop the animation, or rather stop the offset, if suddenly the user has not waited for the block to move into the scope? In fact, the block already has a translate to this area, but it just moves the translate all the time. Can anyone suggest how to implement this? We swiped our finger, the script tries to bring the block to the checkpoint, but the user presses and at this time you need to get his position for how much he could drive, that is, just stop him. Can you stop the animation or something similar to do?
ps This is difficult because, in fact, translate to the end point is, and if you suddenly calculate the coordinates (getBoundingClient), and put this translate block, then it will first reach 1 given point, and then to the desired one - and without animation))))

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question