Here's the on/off toggle I posted earlier, in actual working code. It's a class on a <label> that wraps around a visibility:hidden checkbox. JavaScript looks to see if the checkbox is checked or unchecked, and adjusts the background position accordingly.
You might wonder: Why not just use a checkbox? We wanted this UI to imply immediate effect, rather than the user wonder if they needed to go click a submit button somewhere.
6 Responses
Just a little on/off widget to take the place of what would normally be a checkbox.
about 2 years ago
Like how the light is shining a bit on the edge of the button. Nice detail.
about 2 years ago
But shouldn't it be shining on the inside of the bounding box as well? ^_^
about 2 years ago
@Jason -- Good point, I'll make sure to add that in the production graphic.
about 2 years ago
True. But I like the subtlety here.
about 2 years ago
Rebound
Rebound: On / Off Toggle
by Nathan Smith
Here's the on/off toggle I posted earlier, in actual working code. It's a class on a <label> that wraps around a visibility:hidden checkbox. JavaScript looks to see if the checkbox is checked or unchecked, and adjusts the background position accordingly.
You might wonder: Why not just use a checkbox? We wanted this UI to imply immediate effect, rather than the user wonder if they needed to go click a submit button somewhere.
about 2 years ago