(060)jquery_动画_fadeTo

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN">
<html>
  <head>
    <title>animate_fadeTo.html</title>
    
    <meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
    <meta http-equiv="description" content="this is my page">
    <meta http-equiv="content-type" content="text/html; charset=UTF-8">
    
    <!--<link rel="stylesheet" type="text/css" href="./styles.css">-->
    <style type="text/css">
        span
        {
            width: 70px;
            height: 70px;
            float: left;
            border: solid 1px #ccc;
            margin: 0px 8px;
        }
        .red
        {
            background-color: Red;
        }
        .orange
        {
            background-color:Orange;
        }
        .blue
        {
            background-color: Blue;
        }
    </style>
    <script type="text/javascript" src="../js/jquery/jquery190.js"></script>
    <script type="text/javascript">
        $(function(){
            $("span").each(function(index){
                switch(index){
                    case 0:
                        $(this).fadeTo(3000,0.3);
                        break;
                    case 1:
                        $(this).fadeTo(3000,0.4);
                        break;
                    case 2:
                        $(this).fadeTo(3000,0.5);
                        break;
                }
            });
        });
    </script>
  </head>
  
  <body>
        <h3>使用fadeTo()方法设置淡入淡出效果的不透明度</h3>
        <span class="red"></span>
        <span class="orange"></span>
        <span class="blue"></span>
  </body>
</html>

 

posted @ 2014-12-30 10:38  雪中飞雁  阅读(73)  评论(0)    收藏  举报