News for hackers. Stuff that matters.
Re:CSS3 Flip Switch by mmilo on Sunday February 05, 2012 @06:10AM (#3553826)
Personally I find this to be very inelegant. There is an incredible amount of HTML cruft and Javascript with a bunch of CSS hard-coded into it.

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.

Re:CSS3 Flip Switch by mp3geek on Sunday February 05, 2012 @06:54AM (#3553877)
"Note that other browsers also allow Shadow DOM styling, but to keep things a little simpler, it's just WebKit for now"

Thats such a cop-out.

Re:CSS3 Flip Switch by mmilo on Sunday February 05, 2012 @07:03AM (#3553889)
Even if it only worked in webkit I'd still style native elements and let them fall back to their default look. Creating fake inputs using a bunch of nested divs gives me flashbacks of days when tables were used for layout.
Re:CSS3 Flip Switch by masklinn on Sunday February 05, 2012 @08:50AM (#3554029)
> 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.

Re:CSS3 Flip Switch by p0larboy on Sunday February 05, 2012 @07:46AM (#3553922)
I totally agree simurai examples is so much better. no arguments there.
Re:CSS3 Flip Switch by talmand on Sunday February 05, 2012 @09:51AM (#3554152)
Looks different between Firefox and Chrome. I'm guessing the way it displays for me is wrong since it looks off for some reason.

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.

Re:CSS3 Flip Switch by p0larboy on Sunday February 05, 2012 @10:24AM (#3554243)
It chanced upon me that i should have used input after I had completed the styling for the flip switch. Since I was already halfway there, I just went ahead with the javascript binding.

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~!

Re:CSS3 Flip Switch by talmand on Sunday February 05, 2012 @10:33AM (#3554265)
Oh believe me, I understand the need to get something to the done part once you've fiddled with it for a while. If anything, it's a good start on something that could be expanded into "useful" state. That is, once enough browsers catch up to the CSS3 requirement.

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.

Re:CSS3 Flip Switch by jacobolus on Sunday February 05, 2012 @10:14AM (#3554214)
Pretty sure CSS 3D transforms aren’t available yet in Firefox (at least in non-alpha versions).
Re:CSS3 Flip Switch by mcpherrinm on Sunday February 05, 2012 @01:06PM (#3554658)
The latest release, Firefox 10, has 3D transforms. (I think -- I only have the nightly installed, which certainly does).
Re:CSS3 Flip Switch by jacobolus on Sunday February 05, 2012 @02:34PM (#3554950)
Excuse me, you are right. In my defense, FF10 isn’t quite a week old.
Re:CSS3 Flip Switch by talmand on Sunday February 05, 2012 @10:27AM (#3554249)
3D transforms? I'm curious, what are you referring to?
Re:CSS3 Flip Switch by redguava on Sunday February 05, 2012 @05:57AM (#3553814)
I usually think these "CSS tricks" are neat but I would never use them. This is actually a very nice design and used in the right context could easily add to the UX. Well done!
Re:CSS3 Flip Switch by recursive on Sunday February 05, 2012 @09:35AM (#3554110)
This is confusing. I'm not sure exactly what I'm selecting. When the shadow is red, the "blue" text is more prominent. When the shadow is blue, the "red" text is more prominent. I'm getting contradictory feedback on what I have selected right now. Or am I missing the point?
Re:CSS3 Flip Switch by pedalpete on Sunday February 05, 2012 @09:41AM (#3554130)
You are partially right, but if the label was on/off, I'm sure you would have no issues. The designer should have chosen colors better, but the general function is nice.
Re:CSS3 Flip Switch by p0larboy on Sunday February 05, 2012 @10:29AM (#3554256)
I might need to re-learn the meaning of flip switch. My bad.
Re:CSS3 Flip Switch by p0larboy on Sunday February 05, 2012 @10:28AM (#3554252)
For anyone who wants it, here's the fiddle prototype that i came up with before I implement it. http://jsfiddle.net/colintoh/EyArV/11/
Re:CSS3 Flip Switch by secoif on Sunday February 05, 2012 @06:56AM (#3553882)
Cool, but doesn't work particularly well on iPhone.
Re:CSS3 Flip Switch by fceccon on Sunday February 05, 2012 @10:22AM (#3554236)
I'm on iOS 5 and it works, the border doesn't look crisp though.
Re:CSS3 Flip Switch by p0larboy on Sunday February 05, 2012 @10:27AM (#3554250)
i thought i had it fixed with background-clip but it still haunts me..
Re:CSS3 Flip Switch by p0larboy on Sunday February 05, 2012 @07:48AM (#3553927)
browser version? I tested on iOS5 and it did look worse.
Re:CSS3 Flip Switch by secoif on Thursday February 09, 2012 @08:44PM (#3574098)
Whatever is the latest on iPhone 4.
Re:CSS3 Flip Switch by notahippy on Sunday February 05, 2012 @06:23AM (#3553841)
cursor: pointer; anyone?
Re:CSS3 Flip Switch by p0larboy on Sunday February 05, 2012 @10:29AM (#3554259)
fixed~!