Skip to content

Instantly share code, notes, and snippets.

@monsterooo
Last active October 17, 2016 09:58
Show Gist options
  • Save monsterooo/0daffe71f5a12d729decbc6ecc1dbdf1 to your computer and use it in GitHub Desktop.
Save monsterooo/0daffe71f5a12d729decbc6ecc1dbdf1 to your computer and use it in GitHub Desktop.
The first commented line is your dabblet’s title
/**
* The first commented line is your dabblet’s title
*/
html,body {
padding: 0;
margin: 0;
}
.panel {
transform: translateX(-100%);
transition: transform 0.3s ease-out;
}
.panel {
width:300px;
height: 100%;
position: fixed;
background-color: gold;
}
.panel.active {
transition: transform 0.3s ease-in;
transform: translateX(0);
}
.overlayout {
top: 0;
left: 300px;
width: 100%;
height: 100%;
position: fixed;
background-color: pink;
}
.overlayout {
transition: transform 0.3s ease-out;
transform: translateX(100%);
}
.overlayout.active {
transition: transform 0.3s ease-in;
transform: translateX(0);
}
<div class="panel active" id="panel">
<p>abc</p>
<button id="out">Out</button>
</div>
<div class="overlayout" id="overlayout">
<p>def</p>
<button id="outRight"></button>
</div>
<button id="pop">Pop</button>
<button id="popRight">Pop Def</button>
<br /><br /><br /><br /><br /><br /><br /><br /><br /><br />
<br /><br /><br /><br /><br /><br /><br /><br />
<br /><br /><br /><br /><br /><br /><br /><br />
<br /><br /><br /><br /><br /><br /><br /><br /><br /><br />
<br /><br /><br /><br /><br /><br /><br /><br /><br />
<br /><br /><br /><br /><br /><br /><br /><br /><br />
var pop = document.getElementById('pop');
var popRight = document.getElementById('popRight');
var out = document.getElementById('out');
var outRight = document.getElementById('outRight');
var panel = document.getElementById('panel');
var panelRight = document.getElementById('overlayout');
pop.onclick = function() {
panel.classList.add('active');
}
out.onclick = function() {
panel.classList.remove('active');
}
popRight.onclick = function() {
panelRight.classList.add('active');
}
outRight.onclick = function() {
panelRight.classList.remove('active');
}
{"view":"split-vertical","fontsize":"100","seethrough":"","prefixfree":"1","page":"javascript"}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment