How is this done? Expanding grid (dynamic)

How is this done?

Go to this site: http://www.kurtnoble.com/

When the “Portfolio” section opens, click on an item. Notice how it expands?

Each item will expand to fit the box, no matter where it is positioned. I imagine this is done dynamically according to the item’s location.

Anyone know of a tutorial or example file that can explain this?

Thanks.