You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
For example; If I try to change the opacity of an object when dragging it, I use onDown like this:
var test = new momentum.Draggable(first, {
onDown:function(){ first.style.opacity = 0.5; },
friction: 0.055
});
However, that sets the opacity for all the draggable elements somehow. I made a jsFiddle to demonstrate: https://jsfiddle.net/y6ro8792/1/
Thanks for the great plugin!
The text was updated successfully, but these errors were encountered:
The onDown callback is triggered if the container element gets hit, so in your case you need to check if the coordinates of the click event are inside the bounds of the element you want to modify the opacity.
You already get the prepared parameter hit as first argument. You should also return that in your onDown function in order to tell the handler the click was accepted by the element :)
For example; If I try to change the opacity of an object when dragging it, I use onDown like this:
However, that sets the opacity for all the draggable elements somehow. I made a jsFiddle to demonstrate: https://jsfiddle.net/y6ro8792/1/
Thanks for the great plugin!
The text was updated successfully, but these errors were encountered: