퀵메뉴 잘못된부분좀 알려주세요 채택완료
psj9716
8년 전
조회 2,799
<script>
$(document).ready(function(){
$(window).scroll(function(){
var sct = $(document).scrollTop();
if($('#testbanner').length == 1){
if(sct <= $('.product').offset().top-$('#top').height()){
$('#testbanner').stop().animate({top:270},400);
}else if(sct > $('.product').offset().top-$('#top').height() && sct < $('#footer').offset().top-$('#testbanner').height()-300){
$('#testbanner').stop().animate({top:sct-340},400);
}else if(sct > $('#footer').offset().top-$('#testbanner').height()-550){
$('#testbanner').stop().animate({top:$('#footer').offset().top-$('#testbanner').height()-550},400);
}
}
});
});
</script>
조금 내리면 갑자기 올라가질않나 footer에 닿으면 멈춰아햐는데 넘어가질않나.. 하
댓글을 작성하려면 로그인이 필요합니다.
답변 1개
채택된 답변
+20 포인트
8년 전
</p><p>if(sct <= $('.product').offset().top-$('#top').height()){</p><p><span style="white-space:pre"> </span>$('#testbanner').stop().animate({top:270},400);</p><p><span style="white-space:pre"> </span>} </p><p><span style="white-space:pre"> </span>else {</p><p><span style="white-space:pre"> </span>/*else if(sct > $('.product').offset().top-$('#top').height() && sct < $('#footer').offset().top-$('#testbanner').height()-300){*/</p><p><span style="white-space:pre"> </span>$('#testbanner').stop().animate({top:sct+70},400);</p><p><span style="white-space:pre"> </span>}</p><p><span style="white-space:pre"> </span>/*else if(sct > $('#footer').offset().top-$('#testbanner').height()-550){</p><p><span style="white-space:pre"> </span>$('#testbanner').stop().animate({top:$('#footer').offset().top-$('#testbanner').height()-550},400);</p><p><span style="white-space:pre"> </span>}*/</p><p>
로그인 후 평가할 수 있습니다
댓글을 작성하려면 로그인이 필요합니다.
답변을 작성하려면 로그인이 필요합니다.
로그인