Slide out mobile menu
by zerrax
HTML
<div id="slide" style="height:0;">
<div class="colorize">
<div class="row">
<div class="col">
<label class="line_form">Min Quantity :<input type="text"></label>
</div>
<div class="col">
<label class="line_form">Big Quantity :<input type="text"></label>
</div>
</div>
<div class="row">
<button class="tigger">Close</button>
</div>
</div>
</div>
<button type="button" class="tigger">Menu</button>
CSS
#slide {
overflow-y: auto;
z-index: 100;
background: none;
}
.colorize{
background: #292938;
}
h1 {
font-size: 20px;
line-height: 20px;
background-color: pink;
margin-bottom: 20px;
}
p {
font-size: 16px;
line-height: 20px;
background-color: pink;
margin-bottom: 20px;
}
label{
color: #eee;
}
button {
width: 100%;
height: 20px;
border: 1px solid #888;
border-radius: 5px;
margin: 0 20px 20px 0;
background-color: #ddd;
}
input,button{
text-align:center;
}
input,button:focus {outline:0;}
button:hover{cursor:pointer;background:rgba(255,255,255,0.5)}
div{
}
input{
padding:0;
margin:0;
background: #3f3f54;
border: solid 1px #292938;
-webkit-border-radius: 4px;
-moz-border-radius: 4px;
border-radius: 4px;
color: #eee;
}
.row{
display: grid;
grid-template-columns: repeat( auto-fit, minmax(120px, 1fr) );
grid-gap: 10px;
padding:10px;
}
.f2{
grid-template-columns: auto auto;
}
.col12{
width:100%;
}
.line_form{
display: grid;
grid-template-columns:30% calc(70% - 10px);
text-align:center;
}
.line_form a{
margin-left: 5px;
}
.custom-select {
position: relative;
display: inline-block;
font-family: sans-serif;
font-size: 93%;
}
.custom-select span {
display: inline-block;
width: 100%;
color: #FFF;
background-color: #3f3f54;
cursor: pointer;
border: solid 1px #292938;
text-align: center;
}
.custom-select span a{
pointer-events: none;
}
.custom-select ul {
position: absolute;
background: #3f3f54;
border: 1px solid #333;
border-top:0;
width: 100%;
max-height: 200px;
overflow: auto;
z-index: 10000;
}
.custom-select ul li {
padding: 2px;
border-bottom: 1px solid #333;
cursor: pointer;
color: #eee;
}
.custom-select ul li:hover {
background-color: #666;
color: #FFF;
}
.custom-select ul li:last-child {
border-bottom: none;
}
@media screen and (max-width: 740px) {
...
JavaScript
document.body.onclick = function(e)
{
if (window.event)
{
e = event.srcElement;
}
else
{
e = e.target;
}
if (e.className && e.className == 'tigger')
{
if(document.getElementById("slide").style.height != "100vh")
{
document.getElementById("slide").style.height = "100vh";
}
else
{
document.getElementById("slide").style.height = "0";
}
}
}