jQuery: Partially fading an image





The jQuery Code START
    
  <script type="text/javascript" src="./jquery-1.5.1.js"></script>
  <script src="http://code.jquery.com/jquery-latest.js"></script>
  
    <script type="text/javascript">
      function fade() {
        $('#target').fadeTo(2000, 0.333);
      }
      
      function fadein() {
        $('#target').fadeTo(2000, 1.000);
      }

    </script>
    
    <style type="text/CSS">
        <!--
        .code { color: red; }
        .back { background-color: yellow; }
        .div2 { height:80px;
                width:300px;
                background-image: url(s.gif);
                background-repeat: repeat; }
        -->
   </style>
  </head>

  <body>
    <h1>jQuery: Partially fading an image</h1>
    <img id="target" src="Image1.jpg"/>
    <br />
    <form action="">
    <input type="button" value="Fade" onclick="fade()"></input>
    <input type="button" value="Restore" onclick="fadein()"></input>
    </form>