How to use jquery delegate method?
<p>Hi I have a problem... </p>

<p>I have to show all the results generated from a mysql query using php, in the end I generate a "block" that shortened is like this:</p>

<pre><code>&lt;div class="resultado"&gt;

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

        &lt;h2&gt;Título del artículo&lt;/h2&gt;

    &lt;/div&gt;

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

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

            &lt;div class="encabezado_autores"&gt;
                &lt;img src="images/gente.png"&gt;&lt;span&gt; AUTORES&lt;/span&gt;
            &lt;/div&gt;

            &lt;div class="autores_instituciones"&gt;
                &lt;li&gt;Daniel OC - UTPL&lt;/li&gt;
                &lt;li&gt;Francisco V - UTPL&lt;/li&gt;
            &lt;/div&gt;      

        &lt;/div&gt;

    &lt;/div&gt;

&lt;/div&gt;
</code></pre>

<p>Sometimes searches return 5 results, so that code is inserted 5 times considering the different values (I'm not supposed to use antyhing that is not .hide() and .slide, so that's why I get a looot of code)...</p>

<p>I have a line generated for each result:
    Mostrar resultado n1</p>

<p>That line is clicked and the following event is called:</p>

<pre><code>&lt;script type="text/javascript"&gt;
    $(document).ready(function(){

        $(".resultado").hide(); 

        $('.mostrar').click(function(e){
            $(".resultado").slideToggle();          
        }); 
    });
&lt;/script&gt;
</code></pre>

<p>Ok, so what do I do to use only once that event? Otherwise I have to give 5 different ids and place the script 5 times...</p>
