CSS3 Flip Switch
colintoh.com
colintoh.com
http://lab.simurai.com/css/umbrui/ has some awesome examples of how this sort of thing should be done, using nothing but native HTML 5 form inputs and CSS.
Thats such a cop-out.
Is it really? It's an experiment (that's written on the page), it notes this can be achieved in other browsers but the author just wanted the experiment/demo out, and all the caveats are written up-front.
Looking at the HTML I'm guessing you need javascript to detect it's current state to be able to act on it since it's just a bunch of divs?
I've played with similar ideas but going in a completely different direction. I use a checkbox for my toggle and just use CSS to alter the appearance based on that checkbox, no javascript.
http://jsfiddle.net/talmand/tb9NZ/
Seems to work for me on Firefox and Chrome but not so much IE. It was an experiment so I didn't bother to work out that problem of fallback for IE.
If I'm not wrong, firefox support for css perspective is lacking hence the flip switch looks flatter in firefox.
Saw your fiddle example. Awesome stuff~!
Thanks for the compliment. I'm actually going to be giving a Meetup presentation later this month in the Dallas area on this topic, that's why I was quick on the reply.
Here's more fiddle stuff if you're interested:
http://jsfiddle.net/user/talmand/
I have several examples of using the checkbox in that manner.