Efficiently matching pairs of elements and applying specific hover trigger/animation to each pair
`

$(function(){

    $('.logo').fadeTo("fast", 0);

    $(".logo").hover(function() {
        $(this).stop().animate({"opacity": "1"}, "500");
        $('.sliding_titles div#content-'+this.id).stop().animate({opacity: 1, width: "500px", overflow: "visible" }, 400);},
    function() {
        $(this).stop().animate({"opacity": "0"}, "500");
        $('.sliding_titles div#content-'+this.id).stop().animate({opacity: 0, width: "0px", overflow: "hidden" }, 1);
    });


`

&lt;div id="sliding_titles" class="sliding_titles"&gt;  

&lt;!-- Youtube --&gt;
&lt;div id="content-img1" rel="slide_youtube"&gt;
  &lt;img class="fade_overlay" src="images/sliding_fade_overlay.png" width="100" height="110" /&gt;
  &lt;table&gt;
    &lt;tr&gt;
      &lt;td&gt;          
        &lt;img src="images_example/placeholder_100x100.png" width="100" height="100"&gt;&lt;/td&gt;
      &lt;td&gt;
        &lt;h3&gt;YouTube slideout placeholder content&lt;/h3&gt;
        &lt;p&gt;Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.&lt;/p&gt;
      &lt;/td&gt;
    &lt;/tr&gt;
  &lt;/table&gt;      
&lt;/div&gt;&lt;!-- end .img1 --&gt;

&lt;div id="content-img2" rel="slide_facebook"&gt; ... etc ... &lt;/div&gt;


&lt;div class="logo_wrap"&gt;

    &lt;div class="logo" id="img1" rel="youtube"&gt;
    &lt;/div&gt;&lt;!-- end .logo --&gt;

    &lt;div class="logo" id="img2" rel="facebook"&gt;
    &lt;/div&gt;&lt;!-- end .logo --&gt;

    &lt;div class="logo" id="img3" rel="rss"&gt;
    &lt;/div&gt;&lt;!-- end .logo --&gt;

    ... etc ...

&lt;/div&gt;