Live data from Hacker News

CSS Animated Slide Toggle

jsfiddle.net

11–20 of 26 posts

Re: CSS Animated Slide Toggle

#11
post #4

Just a suggestion: I was annoyed when I first tried to drag the slider. I figured out you have to click it instead, but some users may just quit first.

You can drag it, you just can't end the drag motion outside of the dongle area. Took me a few tries to figure that out myself.

I think that's only because then the click is getting registered, not because of the dragging.

Re: CSS Animated Slide Toggle

#12
Looks nice.

But I think the [x] or [ ] of a normal checkbox are more intuitive than two different colors that may have different meanings in other cultures/countries (and I am not even starting about color blindness).

Re: CSS Animated Slide Toggle

#13
post #4

Just a suggestion: I was annoyed when I first tried to drag the slider. I figured out you have to click it instead, but some users may just quit first.

We used to have two toggles for delivery settings (photo prints/email on/off-- coded as checkboxes) on Picplum and we quickly learned that people tried to drag them as well. So we reverted back to plain checkboxes. Sometimes just because you can do something (and it's pretty) doesn't mean it's usable.

Re: CSS Animated Slide Toggle

#15

Very cool... in Webkit browsers. It's a shame few (if any) other browsers allow you to customize a checkbox this way. Nonetheless, nice work on theming a native checkbox so well. I'd love to use it if it were cross-browser compatible.

I wish joshnh would have included a note about webkit or lack of FF support. I toggled it for 30 seconds or so before opening the source, noticing it was webkit, and switching to Chrome.

Re: CSS Animated Slide Toggle

#16
For CSS demos, I suggest using http://dabblet.com which will automatically add vendor-prefixes. In this case it might not have helped due to the appearance property (which was dropped from the CSS spec [1]), but often only webkit prefixes are used even if properties are supported in other browsers.

1: http://wiki.csswg.org/spec/css4-ui#dropped-css3-features

Re: CSS Animated Slide Toggle

#17
post #16

For CSS demos, I suggest using http://dabblet.com which will automatically add vendor-prefixes. In this case it might not have helped due to the appearance property (which was dropped from the CSS spec [1]), but often only webkit prefixes are used even if properties are supported in other browsers. 1: http://wiki.csswg.org/spec/css4-ui#dropped-css3-features

This won't actually work in any other engine except for webkit, even if you vendor-prefix the rules. This is because he is using an :after pseudo element on a checkbox, which shouldn't work and is technically a bug in webkit (according to the specifications, you cannot use :before/:after on replaced elements).

Re: CSS Animated Slide Toggle

#18
post #16

For CSS demos, I suggest using http://dabblet.com which will automatically add vendor-prefixes. In this case it might not have helped due to the appearance property (which was dropped from the CSS spec [1]), but often only webkit prefixes are used even if properties are supported in other browsers. 1: http://wiki.csswg.org/spec/css4-ui#dropped-css3-features

This won't actually work in any other engine except for webkit, even if you vendor-prefix the rules. This is because he is using an :after pseudo element on a checkbox, which shouldn't work and is technically a bug in webkit (according to the specifications, you cannot use :before/:after on replaced elements).

Oh, didn't notice that. The specification actually does not explicitly prohibit pseudo content on replaced elements.

    This specification does not fully define the interaction of :before and :after with replaced elements (such as IMG in HTML). This will be defined in more detail in a future specification.
http://www.w3.org/TR/2011/REC-CSS2-20110607/generate.html#be...

In my opinion it would be cool if all browsers supported it.

Post reply on HN