Created
July 3, 2012 18:08
-
-
Save siygle/3041453 to your computer and use it in GitHub Desktop.
CSS Slider - [from http://generatedcontent.org/post/26407228072/split-feature]
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
| .box { | |
| width: 880px; | |
| height: 330px; | |
| border-radius: .5em; | |
| } | |
| .sunrise { | |
| position: absolute; | |
| background: #eee; | |
| box-shadow: 0 0 10px rgba(0, 0, 0, .7); | |
| } | |
| .slider { | |
| width: 520px; | |
| overflow: hidden; | |
| display: inline-block; | |
| -webkit-transform: skewX(-20deg); | |
| transform: skewX(-20deg); | |
| -webkit-transition: width 1.2s ease-in-out; | |
| transition: width 1.2s ease-in-out; | |
| margin-left: -76px; | |
| border-right: 10px solid ghostwhite; | |
| pointer-events: none; | |
| } | |
| .sunset { | |
| -webkit-transform: skewX(20deg); | |
| transform: skewX(20deg); | |
| margin-left: 76px; | |
| background: #555; | |
| pointer-events: auto; | |
| } | |
| .slider:hover { | |
| width: 760px; | |
| } | |
| .sunrise:hover + .slider { | |
| width: 250px; | |
| } |
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
| <!doctype html> | |
| <html> | |
| <head> | |
| <link rel="stylesheet" href="index.css" media="screen" type="text/css"> | |
| </head> | |
| <body> | |
| <div class="box sunrise"><a href="#box2"></a></div> | |
| <div class="slider"> | |
| <div class="box sunset"><a href="#box1"></a></div> | |
| </div> | |
| </body> | |
| </html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment