<html>
<head>
</head>
<script src='jquery1.12.4.min.js'></script>
<style>
#bod{
background-color :#FFF; background-image :url(img/2.jpg) ; background-repeat :no-repeat ;background-size:100% 100%;background-position: right bottom ;background-attachment:fixed;
}
*{
margin:0;
padding:0;
}
</style>
<body >
<div id='bod'>
<img style='width:100%;height:100%;' src="img/7.jpg" alt="">
<p style='border:1px solid red;height:700px;color:#ffffff;font-size:50px;'>
zhaoyufei
</p>
<div id='div1' style='margin:0 auto;width:1024px;height:700px;'>
<div style="float:left;text-align:center;width:250px;height:250px;border-radius:50%;border:10px solid red;">1</div>
<div style="float:left;text-align:center;width:250px;height:250px;border-radius:50%;border:10px solid red;">2</div>
<div style="float:left;text-align:center;width:250px;height:250px;border-radius:50%;border:10px solid red;">3</div>
</div>
<div id='middle' style='width:100%;height:100%;background:#ffffff;''></div>
<div style='clear:both;'></div>
<div id='div2' style='margin:0 auto;width:1024px;height:1000px;'>
<div style="float:left;text-align:center;width:250px;height:250px;border-radius:50%;border:10px solid blue;">1</div>
<div style="float:left;text-align:center;width:250px;height:250px;border-radius:50%;border:10px solid blue;">2</div>
<div style="float:left;text-align:center;width:250px;height:250px;border-radius:50%;border:10px solid blue;">3</div>
</div>
</div>
</body>
<script>
$(function(){
var h3_height = $("#middle").offset().top;
$(window).scroll(function(){
var this_scrollTop = $(this).scrollTop();
if(this_scrollTop>h3_height ){
$("#bod").css({"background-image":"url(img/8.jpg)"});
}else{
$("#bod").css({"background-image":"url(img/2.jpg)"});
}
});
});
</script>
</html>