Hi Karl,


Its a bit more confunsing, I simplified too much

In my div, I change a value from a <select>

that triggers a code that clone the <select> parent (the div)

If I do that a few times, every new div goes to the bottom

I do not know what eq() is!! there is a function that return that?

Here is a sample of current code:


    $("#thefilter img#new-criteria").click(function(){
        $last = $('#thefilter .qz-tablefield:eq(1)')
            .clone(true);

        $last
            .appendTo($('#qz-criteria'))
            .hide()
            .fadeIn('medium')
            .find('.clean-criteria')
            .trigger('click');
    });

my <select> triggers that event.  How to adjust with your suggestion?

Feijó


Karl Swedberg escreveu:

Hi Feijó,

you could try this ...

$('div.main > div.sub:eq(2)').after('<div class="sub"></div>');

That should insert your new div after the 3rd one.

--Karl
_________________
Karl Swedberg
www.englishrules.com
www.learningjquery.com



On Feb 11, 2008, at 2:25 PM, Feijó wrote:

consider that html:

<div class=main>
    <div class=sub></div>
    <div class=sub></div>
    <div class=sub></div>
    <div class=sub></div>
    <div class=sub></div>
</div>


I need to append a new <div class=sub></div> as the 2nd, 3rd, middle, etc.
Append() add after the last one.

How can I do that? Its possible?



Thanks
Feijó




Reply via email to