Drag and Drop: Move drop object behind another item.

Mar 07, 2017

I'm creating a drag and drop interaction where the user drops an item into a trash can. The item is dropped onto a hotspot and then using motion path drops down behind the trash can image.

Currently I have the drop object and hotspot set up behind (further down the timeline) the trash can.

I've got the motion path working but the drop item keeps moving in front of the trash can instead of behind it. Any suggestions why this might be?

21 Replies
Paul Tottle

I'm having a similar but different problem. I'm wanting the top most drag & drop object set by "reveal drag items one at a time" to be in the foreground of the drop zone items. However it seems like the target zone objects are given foreground status regardless of any other settings. I would have thought that the top most item to drag & drop would be given foreground status. Any suggestions? Not sure if this is just a limitation of the feature or my lack of knowhow.

Math Notermans

Although this is a simple sample where a click brings an element to a higher z-index and thus shows upfront... this concept can be used in Drag and Drop scenarios too.
https://360.articulate.com/review/content/1a7a1a7e-3562-431a-9d0f-f08d477f0674/review

These lines of Javascript code do the trick...
let card = document.querySelector("[data-acc-text='c_sp10@3x.png']");
gsap.set(card, {css:{zIndex:100}}) 

Where you ofcourse need to take care that the zIndex given to a higher element...indeed is higher then the highest one on your stage. In this case there were 55 layers...so i could suffice with 56.

Steven Benassi

Hi Anastasia!

I'm sorry to hear you've also been affected by this issue!

I don't have any updates to share at this time as our development team prioritizes other fixes. Not to worry! I've included you in the bug report and will update this discussion as soon as we have news to share.

In the meantime, for your reference, here's a deeper look at how we tackle bugs.