How can I disable scrolling on a whole page when I toggle the following:
$('#test').click(function() {
$('html, body').css({
overflow: 'hidden',
height: '100%'
});
});
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<label>
<input id="test" type="checkbox">
<span class="menu">
<span class="hamburger"></span>
</span>
<ul>
<li>
<a href="#">Home</a>
</li>
<li>
<a href="#">About</a>
</li>
<li>
<a href="#">Contact</a>
</li>
</ul>
</label>
Which doesn't seem to work.