I'm having trouble creating a scrolling banner that blurs as you scroll. Whenever I attempt it, the image takes up the entire page background (it's positioned behind all elements but still fills the entire page). I actually want the image to be in a top section like a typical banner.
Using HTML/CSS
<div id="banner-container" object="banner" style="height: 250px; width: 100%">
<div class="banner" style="position: fixed; background-position: center; -webkit-background-size: cover; top: 0; bottom: 0; left: 0; right: 0; z-index: -1; background-image:url('http://s6.postimg.org/d7gcsqvdt/image.jpg')"></div>
<div class="banner-blurred" style="opacity: 0; background-image:url('https://d262ilb51hltx0.cloudfront.net/fit/c/1600/1280/gradv/29/81/40/darken/50/blur/50/0*I7mXgSon9oco-rim.jpeg')"></div>
Implementing JavaScript
$(window).scroll(function() {
var s = $(window).scrollTop(),
opacityVal = (s / 150.0);
$('.banner-blurred').css('opacity', opacityVal);
});