How can I append a div layer to another that uses jquery .animate function?

I have an attached file and would like to append the green box (div layer). To the top of the id="box" gray div layer. So every time the box moves or animates to it's position of x or y that the green box always lays directly centered over the gray div layer touching the gray box.

Thank you,

Brian
indexTEST.html
brihol44Asked:
Who is Participating?
 
remorinaCommented:
Try the below code.
it was placed inside the grey box with absolute positioning, and an extra 50px padding-top was added to the box to accommodate it then finally in order to get rid of the extra grey color, another white absolute div was placed behind the green box to give the final effect, this was all done through CSS

There would be another approach using a different structure where you can create another container, position the green box in it then the grey box under and apply the effect on the main container, but I thought the CSS would be better.



indexTEST.html
0
 
brihol44Author Commented:
Thanks, that worked!
0
 
brihol44Author Commented:
Thanks!
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.