Check out this link to see what I'm talking about.
I'm struggling to make the background image behave the way I want it to.
I need the background to automatically resize based on the width of the window, which it currently does correctly. When you adjust the window size, the background adjusts accordingly.
However, here's the problem. If you widen the window, the background resizes and goes too high, disappearing at the top (since the background is positioned at the bottom). I'd like the background to be positioned at the top when you're at the top of the page, and as you scroll down, it gradually moves to be bottom-positioned. Similar to the effect seen on an Android phone's background when you swipe left and right. But remember, I still want the background to resize automatically when the window is made smaller.
html {
background-color: #70d4e3;
height: 100%;
}
body {
height: 100%;
}
.background {
margin-top: 45px;
width: 100%;
position: fixed;
bottom: 0;
left: 0;
z-index: -9999;
}
.banner {
margin: 0px auto;
width: 991px;
margin-bottom: -9px;
}
.content {
background: url("http://i.imgur.com/daRJl.png") no-repeat scroll center center transparent;
height: 889px;
margin: 0 auto;
width: 869px;
}
.innerContent {
padding: 30px;
}
<img src="http://i.imgur.com/6d5Cm.jpg" alt="" class="background" />
<div class="banner">
<img src="http://i.imgur.com/JptsZ.jpg" alt="" />
</div>
<div class="content">
<div class="innerContent">
testing
</div>
</div>
Perhaps some JavaScript or jQuery would be necessary to achieve this effect.