whoa. this is complicated.
Posted 2013.01.21
Posted at 7:54pm EST; previous post

Silly me. I was really confident this afternoon that I would be able to make my new photo galleries into universal jQuery plugins. I still could do it, but it's going to take a lot more effort that I first thought.

All I needed for this reality check was a gander at my goal: something like the CrossSlide gallery that I use at the front of my website. I have a lot more respect for designer Tobia Conforto after taking a look at his code (and a lot more thanks for the open software movement!).

The end result of his code is that I only have to plug three types of input into my page: the length of time (in seconds) between each picture change, the length of time (in seconds) that the cross-fade will last, and an array of the pictures I want to show. Conforto's code does the rest for me: it extracts the pictures' dimensions, it places the pictures inside the container, it does all the math, it talks to the browser and, most critically for my goal, it does it in a way that makes it easy to put nearly anywhere, in any size, on any web page. (One thing it critically doesn't do, though, is show a caption.)

So, I have a ways to go. Given, though, that all the photos I upload here have a maximum width of 770 pixels and a maximum height of 550 pixels, I can at least standardize the code throughout the site for use on, for example, my portfolio pages. That's a good attainable goal for now.


HTML Comment Box is loading comments...