Created
December 6, 2011 06:46
-
-
Save madpilot/1437093 to your computer and use it in GitHub Desktop.
CSS to create a CSS3 only slider.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
input[type=checkbox] { | |
border: 1px solid #686868; | |
height: 27px; | |
width: 79px; | |
-webkit-appearance: none; | |
-webkit-border-radius: 13px; | |
background-image: url(/blog/wp-content/uploads/2011/12/checkbox-background.png); | |
background-position: -52px 0; | |
background-repeat: no-repeat; | |
-webkit-animation-timing-function: ease-in-out; | |
-webkit-animation-duration: 400ms; | |
-webkit-animation-name: checkbox-switch-off; | |
} | |
input:checked[type=checkbox] { | |
background-position: 0 0; | |
-webkit-animation-name: checkbox-switch-on; | |
} | |
@-webkit-keyframes checkbox-switch-on { | |
from { | |
background-position: -52px 0; | |
} | |
to { | |
background-position: 0 0; | |
} | |
} | |
@-webkit-keyframes checkbox-switch-off { | |
from { | |
background-position: 0 0; | |
} | |
to { | |
background-position: -52px 0; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment