jesstelford / aframe-click-drag-component

Aframe Click & Drag Component
https://jesstelford.github.io/aframe-click-drag-component/
MIT License
103 stars 49 forks source link

how to register drag-drop component on dynamically generated a-frame elements #16

Open jyprksh001 opened 7 years ago

jyprksh001 commented 7 years ago

I have a situation where i am appending elements using jquery to a-scene with click-drag component to the element. but after appending it doesn't fire any event on drag or drop or click. Please help

praneetmehta commented 7 years ago

suppose you are creating a sphere var sphere = document.createElement("a-sphere"); ` sphere.setAttribute("click-drag", true);

this will do the trick :)