Open in app
Jason Knight
111 Followers
About

Sign in

111 Followers
About
Open in app
Drag and Drop With Linear Interpolation in JavaScript
203
1

Sergey Rudenko

Jason Knight

Jason Knight

Sep 17, 2020·1 min read

Sad part is most of that fancy scripting for the animation smoothing could have simply been done by adding a CSS transition to it. Set it to like a quarter of a second, and it would smooth out the input.

transition:top 0.2s, left 0.2s;

And be done with it. Wouldn't even need to play with requestAnimationFrame.

This is 2020, JavaScript is NOT the answer to every blasted problem.

Written by

Jason Knight

More from Jason Knight

More From Medium

HTML/CSS “Analog Clock” With Minimal Javascript

Jason Knight in Level Up Coding

JavaScript Table Sorting (Part 1 of 2) — Start Out Simple

Jason Knight in Level Up Coding

CSS Layouts — Using Flex-Wrap To Get Off The Grid

Jason Knight in Level Up Coding

JavaScript Table Sorting (Part 2 of 2) — Enhancement!

Jason Knight in Level Up Coding

HTTP 2 Push: Fact? Fiction? Placebo?

Jason Knight in Level Up Coding

Overcoming CSS Not Calculating Auto-Height For Transitions

Jason Knight in Level Up Coding

“The CSS Universal Selector Is Slow And Should Be Avoided” — Yet Another Lie!

Jason Knight in Level Up Coding

Stop arguing over the use of loops and side effects in your code

Jason Knight in JavaScript In Plain English

About

Help

Legal

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store