Is there a way to expand a content inside a div but at the same time the div to move upwards?

Is there a way to expand a content inside a div but at the same time the div to move upwards?

Hello everyone, I only have basic html and css knowledge. I am wondering if you can help me with a code?
I think it requires jquery and javascript? I saw on this website https://www.autodesk.com/ three black color divs that are expanding but in the same time they are doing a translation movement?
What I could get from inspecting the code source is function() { if (parseInt($($(this).find(".wp-expanded-content")).css("height")) > 1) {closeCollection(this); } else { expandCollection(this); }}

And there is another one if  (e.target === e.currentTarget) {$(this).find("a")[0].click();} }

Can anyone help? or show me a similar thing? Expand and move at the same time? Thanks