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?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

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

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
brihol44Author Commented:
Thanks, that worked!
0
brihol44Author Commented:
Thanks!
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
jQuery

From novice to tech pro — start learning today.