jQuery - Tying function to selector without an event?
<p>I am just learning how to define a function and call it back later.
I am stuck trying to define 'this' in my function without using an event. </p>

<pre><code>function slide() {
    var imgAlt = $(this).find('img').attr("alt"); 
    var imgTitle = $(this).find('a').attr("href"); 
    var imgDesc = $(this).find('.block').html();  
    var imgDescHeight = $(".main_image").find('.block').height(); 

    $(.active); 
    $(".main_image .block").animate({ opacity: 0, marginBottom: -imgDescHeight }, 250 ,
                function() { 
                    $(".main_image .block").html(imgDesc).animate({ opacity: 0.85,  marginBottom: "0" }, 250 ); 
                    $(".main_image img").attr({ src: imgTitle , alt: imgAlt}); 
                }
            );
     }
   });
</code></pre>

<p>On line 6 you will see '$(.active); ' and this is where I want to select the class active and then apply the following function to it. Normally I used to setting this up on a click or something so I am unsure how to impliment it.</p>

<p>Any help greatly appreciated! Thanks</p>

<p>Here is a js fiddle where you can see the big picture:
<a href="http://jsfiddle.net/wzQj6/21/" rel="nofollow">http://jsfiddle.net/wzQj6/21/</a></p>
