I looked through similar questions here but none have working solution.
I want to hide body content under transparent fixed header when scrolled. Here is an example of what I have now : https://jsfiddle.net/nukuf23L/
If it is possible I would prefer pure CSS but JS/JQuery is acceptable also.
HTML:
<div id="main">
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
</div>
CSS:
body {
margin: 0;
padding: 0;
background: url(http://etc.usf.edu/clipart/80100/80154/80154_grid_20_20_lg.gif) no-repeat center center fixed;
}
#header {
position: fixed;
z-index: 10;
background-color: rgba(0, 0, 0, .7);
width: 100%;
height: 70px;
}
#main {
background-color: rgba(255, 0, 0, .7);
height: 1000px;
position: relative;
top: 70px;
}
Since your background image isn't transparent, the logical thing to do is to apply that image to the header as well as the body.
Since you want a color overlay of that grid image, you would have to apply a second background-image using a linear gradient.
JSfiddle Demo