I'm trying to overlay the page with a div (which be used for a menu), when the checkbox button is checked, but it doesn't seem to work. Is the event not firing?
Jsfiddle here.
HTML
<nav>
<div id="topBar"></div>
<div id="menuTab"><input type="checkbox" id="menuToggle">≡</div>
</nav>
<section>
<div id="slide1" class="slide">
</div>
</section>
CSS
#menuToggle {
height: 24px;
width: 24px;
position: absolute;
top: 0;
left: 0;
margin: 0;
padding: 0;
cursor: pointer;
opacity: 0;
}
input#menuToggle:checked + #menuOverlay {
position:fixed;
top:0;
left:0;
width:100%;
opacity:0.95;
z-index: 3;
}
@media only screen and (min-width: 0px) and (max-width: 768px) {
input#menuToggle:checked + #menuOverlay {
background:#000;
height:100%;
}
}
@media only screen and (min-width: 769px) {
input#menuToggle:checked + #menuOverlay {
background:#1f1f1f;
height:2.4em;
}
}
#menuOverlay