Make object no longer draggable


(raph) #1

Hello!

When using Hype’s in-built “control element position” feature, I am wondering if I can make an object stop being draggable using Javascript / Hype API, or will I need to use jQuery to achieve this?


(Hans-Gerd Claßen) #2

Hi,

the css property pointer events handles well … :wink:

it can be set to none.

so for example you want the element to only be draggable once run below script as drag-behaviour:
if(event['hypeGesturePhase'] === hypeDocument.kHypeGesturePhaseEnd)element.style.pointerEvents = 'none'