본문 바로가기

콩's EDUCATION/콩's Javascript

jquery animate

반응형


<!DOCTYPE HTML >

<html>

 <head>

  <meta charset="utf-8">

  <title>jquery</title>

  <style>

   div {background:#98bf21;height:100px;width:100px}

  </style>

  <script src="http://code.jquery.com/jquery-1.10.1.min.js">

  </script>

  <script type="text/javascript">     

    $(document).ready(function(){

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

var div = $("div"); 

    div.animate({height:300},"slow");

    div.animate({width:300},"slow");

    div.animate({height:100},"slow");

    div.animate({width:100},"slow");

  });

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

 $("div").clearQueue();

  });

});

    </script>


 </head>

 <body>    

 

<p>

<button id="start">Start Animation</button>

<button id="stop">Stop Current Animation</button>

</p>

<div></div>  

 </body>

</html>



반응형

'콩's EDUCATION > 콩's Javascript' 카테고리의 다른 글

script 예제  (0) 2014.06.10
html 기본  (0) 2014.06.09
Javascript 숙제 1 : 설문조사 폼 만들기  (0) 2014.06.09
[KITRI] JavaScript 1장 : html  (0) 2014.06.09
구글 애드센스 코드 분석  (0) 2013.07.30

⚠️ 광고 차단 프로그램 감지

애드블록, 유니콘 등 광고 차단 확장 프로그램을 해제하거나
화이트리스트에 추가해주세요.