How does the javascript behind Google Images work?
<p>Recently, Google Images <a href="https://plus.google.com/+google/posts/eQHPcukkr8S" rel="nofollow">redesigned</a> their site so a large lightbox opens up when you click an image. You can press arrow keys to advance the photo. Does anyone know how it works?</p>

<p>I assume they have divs between the rows, but how do they determine where a row ends or where the next div to expand is? Do they recalculate everything using an onResize event?</p>

<p>I'm pretty new to jQuery so this might be obvious.</p>

<p>EDIT: I should note that for my project all the images are the same size, so I don't need a dynamic layout plugin.</p>
