Change class based on coordinates and/or hit?

Given you have a worked with dragging in Hype before the JS needed to add and remove a class can be found here … basically all you need is to do the following commands:

element.classList.add("draggable");
element.classList.remove("dropped");

and vice versa …

element.classList.remove("draggable");
element.classList.add("dropped");

Update: Just saw that @JimScott posted something :slight_smile: along these line! Two people same thought…

1 Like