All in the .page-wrapper should get the opacity class -- this works
but the button should stay with opacity 1.
I tried this but it doesn't work (the button is inside the page-wrapper)
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"</script>
<script>
$(document).ready(function(){
$("button").click(function(){
$(".page-wrapper:not('button')").toggleClass("opacity")
});
});
</script>
<style>
.opacity
{
opacity:0.4;
}
<button>Toggle class</button>
here is a fiddle http://jsfiddle.net/SY7Np/ display:none is better for my site instead of opacity:0.0
background: rgba(0,0,0,0.5)will give you black background with 50% opacity.