tags:

views:

16

answers:

1

I noticed that the images in this site load in an interesting way.

The site consist in 3 pictures (left. right and middle). After clicking the right picture it moves to the center via jQuery slide / scrollable (i guess) and the new picture on the right loads (it wasn't previously loaded).

How is it done?

+1  A: 

Without actually looking at the code, I'm guessing there's something like this happening:

  • on click of the right image, slide two images left. this will be a live event listener, probably
  • ajax call for the next image
  • on return, load that image into some sort of div, like

I'll dive into the code now and see if that's what's happening. It's pretty slick though.


Edit

It looks like all the images have a div loaded from the start. Then there's a jquery function that puts the image in the div when it's visible.

hookedonwinter
@hookedonwinter Did you spot the jQuery function that does that? So, is not a plugin?
janoChen
It's all in http://walkyrie.org/js/common.js. It looks like if the image is in view, it gets $.scrollable, and if it has that, init() throws the image in. I'm not exactly clear on how it works though.
hookedonwinter
@hookedonwinter OK thanks I'll study it a bit.
janoChen
@janoChen look at the `gogo` part. I think that's where the script checks to see if things are in the right place, and then the show starts.
hookedonwinter
@hookedonwinter OK, thank!
janoChen