I am trying to get a basic drag and drop to work. I looked at a few examples and decided to ‘hack’ the NoaStars project. I am not a coder. I seem to have been endowed with a low coding aptitude.
The function works, except for the fact that it doesn’t recognise the correct drop.
As the knowledge base in these forums is quite vast and all the experts have their own style(personality) of coding, I get lost.
Nice to see my NoaStars project helps people to accomplish a drag&drop function in their project. If you need any further help, I’m happy to help you out!
Hi. Thanks for all the help. My drag and drop works well now.
I have a question though and I found this question asked a few times in the forums, but can’t find my answer yet.
After the drag and drop is completed, I need to be able to trigger a timeline either by user intervention or automatically. Either will suffice at the moment.
So as the drop happens I hide the dropped object and switch on(visible) another. First I thought one could check if the element is visible, but I don’t know how to as I’ve asked someone I know that does quite a bit of coding and he said there is no such property in javascript. Just its inverse.
Now I think I must check whether that element I switched on’s opacity is at a 100%. Which I add to the timeline that is triggered on the drop. I tried this code at the bottom, but I am either so close that I can’t see the solution, or I am smoking something.
var DnDB = hypeDocument.getElementById("Bdropped");
if ((hypeDocument.getElementProperty(DnDB, 'opacity') == '1'){
hypeDocument.startTimelineNamed('dropzoneGiggle', hypeDocument.kDirectionForward);
}
Why not start a timeline in the drag&drop script when the drop is successful? With this timeline you can hide the dragged element, show another and so on…
I did do that. I saw that in your kokeshi example. Now to continue I need to check if all the drops were done. The element properties/attribute that change ‘on drop’ is visibility.
If I can get this to work it would be great. I managed to check the display property in a javascript that is dependant on user intervention (button), but your idea can check without that. Will definitely look into it.