card background pattern
Level 2

Animating React with Framer Motion

Unlock Full Course

$49.99 $39.99

Or

$24.99/Month

Drag and Drag Constraints

As we dive deeper into gesture-based animations, we will look at dragging with Framer Motion.

Downloads

Comments

Simon
2 months ago

@Erik Hals You can also prevent the image from dragging by using

pointer-events: none

on the img css

Spencer
3 months ago

@Erik Hals nice find!!

Erik Hals
updated 3 months ago

In Chrome, the card sometimes froze when trying to drag it, as the img itself is draggable to the desktop. Found it can be prevented by adding -webkit-user-drag: none; to the img in Elements.js.

Something to say?

Become a Pro