jQuery日本語リファレンス

jQuery does not mean Japanese Query...

Effects/API/jQuery - Sample Code

animate(params, options)


            
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" 
                    "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
  <script src="/jquery/js/jquery.js"></script>
  <script src="/jquery/js/jquery.easing.js"></script>
  
  <script>
  $(document).ready(function(){

    $("#animate").click(function(){
      $(".block").animate(
        {width: "toggle", opacity: "toggle"},
        {duration: "slow", easing: "linear",
         complete: function(){alert("completed!");},
         step: function(s){$("#steps").text(s)}
        }
      );
    });

  });
  </script>
  <style>
  div { 
    position:absolute; 
    background-color:#abc; 
    left:50px;
    width:300px; 
    height:90px;
    margin:5px; 
  }
  </style>
</head>
<body>

<button id="animate">animate</button>
<p id="steps"></p>
<div class="block"></div>
</body>
</html>
            
          
[実行結果]
[animate(params, options) の説明へ]