How to use jquery with variable assigned
<p>How can I use a variable in jQuery. as you see in script snippet, I assign a variable "divname" with value, and when i use 'Jquery" to fade out. it is not working. What I really need is, when image is hover, the description will be show up as fading in, when mouse is gone, the the description should be gone. thanks in advance. </p>

<p>Script snippet</p>

<pre><code>    $j('.img_nofade').hover(function(){  
    $j(this).animate({opacity: .5}, 300);
          var i = $j(this).attr('titlename');
          var divname = "'#titleID" + i + "'";
          //alert (divname);
          $j(divname).fadeIn();
    }, 
    function(){  
       $j(this).animate({opacity: 1}, 300);
          $j(divname).fadeOut();
       }  
    );
</code></pre>

<p>HTML code</p>

<pre><code>     &lt;img class="img_nofade' src="image-1.gif" titleid='1" /&gt; 
     &lt;div id="titleID1"&gt;my image title 1 &lt;/div&gt;


     &lt;img class="img_nofade' src="image-2.gif" titleid='2" /&gt; 
     &lt;div id="titleID2"&gt;my image title 2 &lt;/div&gt;

      &lt;img class="img_nofade' src="image-3.gif" titleid='3" /&gt; 
     &lt;div id="titleID3"&gt;my image title 3 &lt;/div&gt;
</code></pre>
