제이쿼리 animate 질문드립니다. 채택완료
$(document).ready(function() {
$(window).scroll(function(){
var scroll = $(window).scrollTop();
if (scroll >= 200){
$('#b').animate({left:'+200'},500);
$('#a').animate({top:'0'},500);
}else{
$('#b').animate({left:'0'},500);
$('#a').animate({top:'-50'},500);
}
});
});
스크롤 아래로 했을때
animate 해서 나오게 하는걸 짯는데, 동시에 말고 순차적으로 animate작동하게 하려면 어떻게 해야할까요??
답변 1개
https://sir.kr/pg_tip/14137">https://sir.kr/pg_tip/14137
이걸 참고했을때....
$('#b').animate({left:'+200'},500,null, function(){$('#a').animate({top:'0'},500)});
이런식으로 넣어보시는건 어떨까요..?
답변에 대한 댓글 1개
댓글을 작성하려면 로그인이 필요합니다.
답변을 작성하려면 로그인이 필요합니다.
로그인