As the title states I want to create a button which enables/disables overflow:hidden in the page. and the default stance should be that the overflow:hidden is active and the page cant be scrolled.
I looked around for something similiar, didnt find anything.
EDIT:
Ok heres what I did with your help, having trouble linking the function to a button. I might be miss understading something cause my skills in html and Jquery are limited.
After some research i got it to work by making the selector select an id and i gave the button and id.
$(function (){
$("#buttoni").on('click', function(e){
e.preventDefault();
$('body').toggleClass('no-scroll');
});
});
and the button:
<button id="buttoni"> toggle scroll</button>
And that way i got it to work, im not sure what i missunderstood in the original to not get it to work but THANKS