Apply CSS to multiple elements with same class based on class of currently hovered
<p>I have multiple elements on a page that have matching classes.  The classes are built by a variable so I can't hard code the css into a stylesheet.  The elements that make up the page will constantly change and so I need some javascript to find the element's class and then apply some css for that class.  It's on a site with Jquery, Drupal (views) if that helps at all...</p>

<p>I'm part of the way there.  I've written the following script:</p>

<pre><code>$(document).ready(function(){
$("a").hover(function() {
   var myClass = $(this).attr("class");
   $(.$myClass).hover(function(){
      $(this).css({
      border : '3px solid red',
      color : 'red'
      });
   });
});
});
</code></pre>

<p>Now if I put in there an 'alert', I see that it is capturing the class of the element that is currently being hovered over.  But I can't get it to then find all of the elements on the page with that class and apply the css.  To add some info, the two elements that I am trying to adjust are a small thumbnail image which I would like to add a border around, and the title of a linked node which I would like to change color.</p>

<p>Any help is much appreciated.</p>
