더 나은 프로그래머가 되자

jquery stop() 함수 (애니메이션 멈추기) 본문

언어/js

jquery stop() 함수 (애니메이션 멈추기)

greathuman 2014. 2. 21. 14:40

<script type="text/javascript">
$(document).ready(function(){

  // 애니메이션 시작

  $("#start").click(function(){

    $("div").animate({left:'100px'},5000);

    $("div").animate({fontSize:'3em'},5000);

  });

  // 애니메이션 중지

  $("#stop").click(function(){

    $("div").stop();

  });

  // 모든 애니메이션 중지

  $("#stop2").click(function(){

    $("div").stop(true);

  });

  // 모든 애니메이션 중지 및 최종상태로 변경

  $("#stop3").click(function(){

    $("div").stop(true,true);

  });

});
</script>

'언어 > js' 카테고리의 다른 글

jquery 유용한 팁(콤마,숫자체크,커서변경 등)  (0) 2014.05.26
브라우저 언어 체크  (0) 2014.03.26
jquery onchange 처리  (0) 2014.02.18
form reset 폼 리셋  (0) 2014.02.18
탑메뉴 고정 jquery  (0) 2013.06.13
Comments