[jQuery] Re: problem in removing and moving

2009-01-30 Thread Ricardo Tomasi
var $fields = $('#div'); // not a good idea for an id var firstDL = $fields.find('dl:first-child')[0]; $(XXX).each(function(){ if ( $(this).prev('dl').is( firstDL ) ) blowUp(); }); or if ( $fields.index( $(this.prev('dl')[0] ) == 0 ) or if ( $(this.prev('dl')[0] == $('#div dl:first')[0]

[jQuery] Re: problem in removing and moving

2009-01-30 Thread Jack Finger
Anybody knows?

[jQuery] Re: problem in removing and moving

2008-12-21 Thread Jack Finger
Thanks to Dave Methvin, it runs. I didn't try Kean's solution, Dave's was simpler. And I have one more question: HTML: ...something... ...something... ... ... ... ... JS: if(previous dl is first dl){ ...} else { ... } - how can I write the condition? (e.g. I have this condition in sec

[jQuery] Re: problem in removing and moving

2008-12-21 Thread Jack Finger
Thanks to Dave Methvin, it runs. I didn't try Kean's solution, because David's was simpler, but thanks too. And I have one more question: ...something... ...something... ... ... ... JS: if(previous dl == first dl) - how can I check if previous of 'this dl' is the first 'dl', e.g. I ha

[jQuery] Re: problem in removing and moving

2008-12-21 Thread Dave Methvin
> >   ...something... > > >   ...something... TO MOVE > How about this? $("#to_move").parents("dl:first").prev().find("dd").append($ ("#to_move"));

[jQuery] Re: problem in removing and moving

2008-12-21 Thread Kean
I am moving If i am inserting into any , regardless where my is in (ie. it can be in the third , fifth etc) var idx = 2; //place with other numbers $("#moving").insertAfter($("#moving").parent('#notDiv').find("li:nth- child("+idx+") b"); If i am inserting after the previous , regardless