could someone please tell help me with this code?
Basically I have 2 identical images one is shot in daylight where the other one is shot at night, I want it where the light one is the original image and as the page is scrolled down its starts to blend into the darker one.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>BG Test</title>
<script>
var start = 100 // how far the user has to scroll down before it start fading
var end = 1200 // the number of pixels the user has to scroll down before the opacity is 0.
$(document).scroll(function(){
if(scrollTop>start){
$('images/MainLight.png').css({'body':(end-scrollTop)/(end-start)});
}
});
</script>
</head>
<style type="text/css">
body{
background:url(images/MainLight.png) no-repeat center center fixed;
opacity:100;
width:100%;
z-index:-1;
}
bgimg{
background:url(images/MainDark.png) no-repeat center center fixed;
opacity:100;
width:100%;
z-index:0;
}
</style>
<div class="body" >
Top!
<br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br />
<br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /> <br /><br /><br /><br /><br /><br /><br /><br />
Middle!
<br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /> <br /><br /><br /><br /><br /><br /><br /><br />
<br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br />
Bottom!
</div>
<body>
</body>
</html>
Many Thanks in advance.