预览地址:
html:
$(window).scroll(function()
{
saction();
});
function saction()
{
sj = 20; //底部间隔
st = $(window).scrollTop(); //滚动条高度
sd = $(".left_poi").offset().top;
sd_h = $(".left_in").height();
sb = $(".bottom").offset().top;
sb_h = $(".bottom").height();
rd_h = $(".right").height();
bh = window.innerHeight;
si = sb-sd_h;
if(st>sd && rd_h>=sd_h){
$(".left_in").addClass("on");
if(st>si){
sy = bh-(sb-st)+sj;
$(".left_in").css({"top":"auto","bottom":sy+"px"});
}else{
$(".left_in").css({"top":"","bottom":""});
}
}else{
$(".left_in").removeClass("on");
}
}