Created
March 18, 2012 16:08
-
-
Save anonymous/2076416 to your computer and use it in GitHub Desktop.
Untitled
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
.up, .down, .left, .right { | |
position: absolute; | |
margin-top: 100%; | |
margin-left: 50%; | |
font-size: 40px; | |
width: 50px; | |
height: 50px; | |
} | |
.up { | |
top: -300px; | |
left: -25px; | |
} | |
.down { | |
top: -200px; | |
left: -25px; | |
} | |
.left { | |
top: -250px; | |
left: -75px; | |
} | |
.right { | |
top: -250px; | |
left: 25px; | |
} | |
.up:active ~ .box { | |
transition: margin-top 2s linear, | |
margin-left 2s linear; | |
margin-top: 1px; | |
} | |
.down:active ~ .box { | |
transition: margin-top 2s linear, | |
margin-left 2s linear; | |
margin-top: 500px; | |
} | |
.left:active ~ .box { | |
transition: margin-top 2s linear, | |
margin-left 2s linear; | |
margin-left: 1px; | |
} | |
.right:active ~ .box { | |
transition: margin-top 2s linear, | |
margin-left 2s linear; | |
margin-left: 500px; | |
} | |
.box { | |
width: 100px; | |
height: 100px; | |
background:red; | |
transition-property: margin-top, margin-left; | |
transition-duration: 0; | |
transition-delay: 999999s; | |
transition-timing-function: linear; | |
} |
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
<button class="up" accesskey="j">↑</button> | |
<button class="down" accesskey="k">↓</button> | |
<button class="left" >←</buton> | |
<button class="right">→</button> | |
<div class="box"></div> |
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
{"view":"split-vertical","seethrough":"","prefixfree":"1","page":"css"} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment