Fade to callback : fadeTo « jQuery « JavaScript Tutorial






<html>
  <head>
    <script type="text/javascript" src="js/jquery-1.3.2.js"></script>
    <script type="text/javascript">
        $(document).ready(function(){
            $("div").fadeTo(250, Math.random(),function () {
              alert("done");
            });
         
        });
    </script>
  </head>
  <body>
    <body>
          <div>Click me</div>
    </body>
</html>








30.40.fadeTo
30.40.1.Fade to a certain opacity
30.40.2.Fade to callback
30.40.3.Fast fade to
30.40.4.Fade to in milliseconds
30.40.5.Fade to random
30.40.6.Slow fade to
30.40.7.fadeTo(speed, opacity, callback): Only the opacity is adjusted for this animation