Forum Discussion
ZoeFaulder-a3d3
9 years agoCommunity Member
Drag and Drop: Move drop object behind another item.
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.
Current...
MathNotermans-9
3 years agoCommunity Member
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.
AnnaNasse
3 years agoCommunity Member
Thank you! I will try it :)
Related Content
- 11 months ago
- 10 years ago
- 2 years ago
- 2 months ago