title: grabbing the closest element
body: <p>i am working on a gallery where i need to add a class to image when the overlay div is hovered.</p>
  
  <p>this is my html</p>
  
  <pre><code> &lt;div class="overlayForCarDetails"&gt;&lt;/div&gt;
   &lt;a href="img/car_details/1large.jpg" rel="shadowbox"&gt;
     &lt;img class="mediumImg" src="img/car_details/1medium.jpg" alt=""&gt;
   &lt;/a&gt;
  </code></pre>
  
  <p>And this is my javascript</p>
  
  <pre><code>        $('.overlayForCarDetails').mouseenter(function () {
              $(this).css('opacity', '0.7');
              $(this).closest('.mediumImg').addClass('zoomed');
  
          });
  </code></pre>
  
  <p>But somehow its not working.
  Can you tell me where am i doing it wrong.
  thanks.</p>