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

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

QA

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

본문


<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);
			}*/
답변을 작성하시기 전에 로그인 해주세요.
전체 34
QA 내용 검색

회원로그인

(주)에스아이알소프트 / 대표:홍석명 / (06211) 서울특별시 강남구 역삼동 707-34 한신인터밸리24 서관 1404호 / E-Mail: admin@sir.kr
사업자등록번호: 217-81-36347 / 통신판매업신고번호:2014-서울강남-02098호 / 개인정보보호책임자:김민섭(minsup@sir.kr)
© SIRSOFT