Created
March 12, 2013 11:05
-
-
Save tomax/5142051 to your computer and use it in GitHub Desktop.
Using :active state to close menu item
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
| /** | |
| * Using :active state to close menu item | |
| */ | |
| body { | |
| background: #f06; | |
| background: linear-gradient(45deg, #f06, yellow); | |
| min-height: 100%; | |
| position:relative; | |
| } | |
| ul li { | |
| position:relative; | |
| left:-48px; | |
| background-color:white; | |
| transition: 0.8s; | |
| width: 60px; | |
| } | |
| li:hover { | |
| width: 200px; | |
| } | |
| li:active { | |
| width: 60px; | |
| left:-200px; | |
| transition: 0; | |
| } |
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
| <!-- content to be placed inside <body>…</body> --> | |
| <ul> | |
| <li><a href="#">some text</a></li> | |
| <li><a href="#">some text</a></li> | |
| <li><a href="#">some text</a></li> | |
| <li><a href="#">some text</a></li> | |
| </ul> |
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
| // alert('Hello world!'); |
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":"separate","fontsize":"100","seethrough":"","prefixfree":"1","page":"all"} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment