sibar随着滚动,快到footer停止;

var hh = $(window).height()-450;//450
$(".newsListCon ul").height(hh);
var lineHig =$(".destDiv").offset().top;

//旁边浮动的
var ajustRightFloat = function(){
var botH=$(window).height()+$(window).scrollTop();
var ch=lineHig-botH;

// console.log(botH)
if($(window).scrollTop()<780){
$(".traSlideLeft h4,.traSlideRight").css("position","static");

}else if($(window).scrollTop()>=780&&ch>=0){
$(".traSlideLeft h4").css("position","fixed");
$(".traSlideLeft h4").css("top",0);
$(".traSlideRight").css("position","fixed");
$(".traSlideRight").css("top",0);

}else if(ch<0){
console.log("dd");
$(".traSlideLeft h4").css("position","fixed");
$(".traSlideLeft h4").css("top",0);
$(".traSlideRight").css("position","fixed");
$(".traSlideRight").css("top",ch-30)

}
}
$(window).scroll(ajustRightFloat);

 

posted @ 2015-11-18 17:53  野蛮坏坏女  阅读(110)  评论(0)    收藏  举报