퀵메뉴 잘못된부분좀 알려주세요

퀵메뉴 잘못된부분좀 알려주세요

QA

퀵메뉴 잘못된부분좀 알려주세요

답변 1

본문


<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


if(sct <= $('.product').offset().top-$('#top').height()){
				$('#testbanner').stop().animate({top:270},400);
			} 
			else {
			/*else if(sct > $('.product').offset().top-$('#top').height() && sct < $('#footer').offset().top-$('#testbanner').height()-300){*/
				$('#testbanner').stop().animate({top:sct+70},400);
			}
			/*else if(sct > $('#footer').offset().top-$('#testbanner').height()-550){
				$('#testbanner').stop().animate({top:$('#footer').offset().top-$('#testbanner').height()-550},400);
			}*/
답변을 작성하시기 전에 로그인 해주세요.
QA 내용 검색
질문등록
  • 질문이 없습니다.
전체 0
© SIRSOFT
현재 페이지 제일 처음으로