animate

j-look-j·2022년 8월 16일

HTML

목록 보기
2/4

animate 기본 형식

animate({ 속성:"값" }, "변경속도", function(){});
변경 속도: slow , fast , number(1000=1sec)
<script>
animate({ left:"+=20px",width:"100px" }, "2000" );
</script>

animate 종료후 설정 값 지정(function)

animate 속성 입력 마지막에 function 을 입력하면 animate 가 끝난 뒤에 되돌아갈 값을 지정 할 수 있다.

<script>
$("img").animate({width:'+=30px',height:'200px',opacity:'0.5'},'slow',function () { 
	$(this).css({
      width:'100px',
      height:'100px',
      opacity:1			//투명도 설정
    });
	$(this).after("<h3>이미지 애니메이트 끝</h3>");
});
</script>

0개의 댓글