Antonio,

I am trying something similar. I copied your code but it does not
work. Is there something missing from the post?

On Dec 16 2007, 9:44 am, Antonio Jozzolino
<[EMAIL PROTECTED]> wrote:
> Everything works fine now. Thanks a lot!
>
> html
>
>         <div class="add-more">
>                 <label for="empresas_coligadas_ou_filiais" class="label-
> ecf">Empresas Coligadas ou Filiais</label>
>                 <input name="empresas_coligadas_ou_filiais" type="text"
> maxlength="255" />
>                 <span class="bt-more"></span>
>             <span class="bt-less"></span>
>         </div>
>
> js
>
>         $('span.bt-more').bind('click', function(){cloneDiv($(this))});
>         $('span.bt-less').bind('click', function(){removeDiv($(this))});
>
> function cloneDiv(e)
> {
>         var ee = e.parent();
>         var cc = ee.clone();
>         cc.insertAfter(ee);
>         $('span.bt-more').unbind();
>         $('span.bt-more').bind('click', function(){cloneDiv($(this))});
>         $('span.bt-less').bind('click', function(){removeDiv($(this))});
>         $($(cc[0]).children()[0]).css('visibility', 'hidden');
>         $($(cc[0]).children()[3]).css('visibility', 'visible');}
>
> function removeDiv(e)
> {
>         var ee = e.parent();
>         ee.remove();
>
> }

Reply via email to