Strapline

October 23rd, 2006

I’ve finally got around to writing a bit of script to randomise the strapline that appears under the Robotperson logo above - hit refresh a few times to see it change. To javaScript adepts it will probably seem trivially simple, but to me there’s something incredibly satisfying about working out what needs to happen, then getting it to actually work.

I got into DOM scripting a few months ago after a training day with Jeremy Keith at work. Inspired, I scripted the gallery behaviour on a photography site I was working on at the time for a friend - check out one of the galleries: the breadcrumb, next, previous, and thumbs links, image, and image title on the full-size preview page are all populated from the script.

But when I sat down to do the strapline, I found that the concepts had pretty much evaporated. A quick reference to Keith’s DOM scripting book got me back on the horse, and the result is an efficient and elegant bit of code that I’m almost irrationally happy with.

Some of the straps are off the top of my head but see if you can spot where the rest of the quotes are from. I’ll be adding to them whenever I find something suitably robotic.

Comment on this post

You must be logged in to post a comment.