September 28, 2008 | Web Design & Development
Update: This script has been overhauled since this post. View the new code and demo here.
As fate would have it the first night of my trip to Provo, Utah turned in to an all night work session to get a few things wrapped up so that we could release them during WordCamp Utah. As it turned out we needed a last minute feature to show off some images. Thanks to the miracle of jQuery it turned out to be all of a 30 minute venture.
I have to admit it feels a bit hackish, but in my defense it was done at 4am. Please also keep in mind I’m writing this after being up all night.
First, the example: Click here to view the example page.
The goal was to have a screenshot gallery viewer that nicely and quietly sat in the page so that we could maintain the simple & clean layout of the page and also allow us to dynamically update the featured images and not have to fuss with any logic to make new images work and also not have to load a carousel plugin to do it. After a quick conversation with Alex (the boss) we had the distance logic pretty much figured out and just had to write it. The principle is very simple and hopefully the code is commented enough to be self explanatory.
So, is there anything extra special about this? I don’t think so. Is it still neat? Yeah, I think so. Its nice, clean functionality in a small package. I think the neatest little thing going on is that in all browsers jQuery recognizes that "’left’:+=-760" is negative movement.
If you’re so inclined, head on over to the site and see it in action. I guess that pretty much says where I work (I’ve tried my best to keep my employers away from this blog, but now that I’m actually working in the social networking space I guess its ok). Or, if you’re so bold, steal this script!