Skip to content

Instantly share code, notes, and snippets.

@ynonp
Created November 24, 2012 18:20
Show Gist options
  • Save ynonp/4140781 to your computer and use it in GitHub Desktop.
Save ynonp/4140781 to your computer and use it in GitHub Desktop.
Untitled
div#viewport {
border: 5px solid hotpink;
width: 320px;
height: 180px;
position:relative;
margin: 0 auto;
}
div div {
width: 320px;
height: 180px;
position: absolute;
}
div.left div {
-webkit-transform: translateX(100%);
}
div.right div {
-webkit-transform: translateX(-100%);
}
div div:nth-child(1) {
background: blue;
left: -100%;
}
div div:nth-child(2) {
background: red;
left: 0;
}
div div:nth-child(3) {
background: green;
left: 100%;
}
<div id=viewport>
<div></div>
<div></div>
<div></div>
</div>
<button>Prev</button>
<button>Next</button>
// alert('Hello world!');
{"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