This is the celebrated journal of Mr. Simon Collison A.K.A Colly

Colly’s CSS rollover generator

4th December 2004

Further to the previous post detailing multi-element rollovers, incorporating background color and XHTML text with images, I have created a pretty sturdy thing called Colly’s advanced rollover generator.

CSS generator image

By removing the advanced fields, you can simply create a standard “sliding doors” rollover, or use the extra fields to create an advanced rollover with background and text elements. The CSS produced is lean and clean, and I’ve included a few extra fields to help you tighten your design further.

Step one - define the CSS

By using Malarkey’s excellent Trimming form fields tutorial, it is easy to get rid of the fields required to create advanced rollovers, leaving basic fields to power the rollover. Otherwise, to create a more advanced rollover, you just follow the basic instructions. It pays to create a “sliding doors” image first of all, though. A sliding doors image consists of the two image states side-by-side, equal in width. So, a 200px width image would sit next to a rollover version - also 200px, creating a sliding door image of 400px. Sliding doors remove the need for two images, and reduce flickering in some browsers. I have coded in a reference to one of my images in the image field for you to try.

detail

Step two - complete CSS, XHTML and example

The generator produces simple, lean CSS, and successfully removes unwanted styles from the CSS. Not quite what you wanted? No problem - hit the back button and keep defining the CSS until you are happy with the image.

another detail

Let me know what you think

This is my first CSS generator - and I’d like to make more. The PHP did give me a headache, but I’m alright now. Maybe I’ll make an other for the ticked-off links technique. Anyway, any opinions welcome.

Colly’s advanced rollover generator.

Responses

Malarkey

# Malarkey responded on 5th December 2004 with...

I think it’s fab!

Jay

# Jay responded on 6th December 2004 with...

i love you Simon!
very nice idea.

James

# James responded on 6th December 2004 with...

Ha! I just spent an afternoon configuring my rollovers based on your previous post… and then you go and make a bloody generator that does all the work for me. Great.

Thanks tho. More generators please!

Blair Millen

# Blair Millen responded on 6th December 2004 with...

Neat as hell!

Christian Watson

# Christian Watson responded on 7th December 2004 with...

This is a great tool. Nice job, and thanks!

Jon Hicks

# Jon Hicks responded on 7th December 2004 with...

Nice work Colly you boffin, this must’ve taken a wee while! I now picture you in a lab coat, toiling over bubbling test tubes and a powerbook.

Adrian Kostrubiak

# Adrian Kostrubiak responded on 8th December 2004 with...

Wow that’s incredible.  Very cool.
The one thing that I noticed that was wrong was that it’s escaping the quotations (with a slash) in the font section of the CSS. Like this:

font:normal 8px \’Lucida Grande\’;

Other than that slight issue, this is an incredible tool!

Simon Collison

# Simon Collison responded on 8th December 2004 with...

Hey-hey, thanks all for the positive feedback. I’ve already got two more generators on the go, which I’ll flag up soon. Anyone want to suggest generators?

Adrian: Well spotted. I’ll escape those slashes as soon as I get a chance.

Hicks: Since we met, I have undergone transmogrification, and I now resemble Beeker from the Muppets.

Carlo

# Carlo responded on 14th December 2004 with...

This is a brilliant tool. Just used it and it worked a treat. Thanks.

Derek Featherstone

# Derek Featherstone responded on 17th December 2004 with...

Nice stuff, Simon… I’m now actively looking for ways to use this in for a project or two…

patrick h. lauke

# patrick h. lauke responded on 12th January 2005 with...

give me a shout next time PHP gives you a headache ... more than glad to help.

Simon Collison

# Simon Collison responded on 12th January 2005 with...

Thanks Patrick - I just might take you up on that!

Derek, let me know if you do use it.

Website

# Website responded on 1st February 2005 with...

This is pretty cool. Heh :)

Insurance

# Insurance responded on 19th June 2005 with...

Nice work Colly you boffin, this mustĂve taken a wee while! I now picture you in a lab coat, toiling over bubbling test tubes and a powerbook.

Responses are now disabled Your ability to respond is disabled automatically some 30 days after articles are published, or manually much sooner if spamming guttersnipes target a particular article.

Prev 346 Next

Superfluous Aside

This post's Short URL is http://col.ly/s/346

There are 14 responses

External References

Copyright © Mr. Simon Collison 2003-2011. Protected and licensed under a Creative Commons License. Grab the RSS feed

Engineered in Nottingham, scaffolded by ExpressionEngine, steam-pumped by United & kept alive with tea and roll-ups.