$(document).ready(function(e) {
t = $('.piaofu').offset().top;
mh = $('.left').height();
fh = $('.piaofu').height();
$(window).scroll(function(e){
s = $(document).scrollTop();
if(s > t - 10){
$('.piaofu').css('position','fixed');
if(s + fh > mh){
$('.piaofu').css('top',mh-s-fh+'px');
}
}else{
$('.piaofu').css('position','');
}
})
});
*{ padding:0px; margin:0px;}
.box{ width:1000px; background:#ccc; margin:0 auto; overflow:hidden;}
.left{ width:770px;height:2000px; background:#000;float:left;}
.right{ width:220px; background:#FC6; float:right;}
.sub01{ width:220px; height:100px; background:#0CC; margin-bottom:10px;}
.piaofu{ width:220px; height:300px; background:#F66; font:normal 13px/30px \5FAE\8F6F\96C5\9ED1; text-align:center; top:10px;}