DEV Community

loading...

Discussion on: A JavaScript interview question asked at Facebook

Collapse
elisabethgross profile image
elisabethgross Author

Nice! Although this will move the element from a given position, rather than where it is on the page.

Collapse
tomshaw profile image
Tom Shaw

Thanks! Another fun challenge would be to add a timing function lerp, similar to cubic-bezier(x1, y1, x2, y2) to vary the speed over the course of the duration. It's a leap forward in complexity but quite doable.