You might also want to check out Stefan Petre's Interface plugin, which has a sortables module, if you want to do more moving around of divs. http://interface.eyecon.ro/
Karl _______________________ Karl Swedberg www.englishrules.com www.learningjquery.com On Nov 18, 2006, at 5:41 AM, Subway wrote: > > Thx a lot. Guess I was just thinking way too complicated. ;-) > > Fredi > > > Jörn Zaefferer wrote: >> >> Subway schrieb: >>> Let's say I have a structure like this: >>> >>> <div id="container"> >>> >>> <div id="box1">box 1 content</div> >>> <div id="box2">box 2 content</div> >>> <div id="box3">box 3 content</div> >>> <div id="box4">box 4 content</div> >>> >>> </div> >>> >>> Now how do I move one of those divs, lets say box3 to the top of the >>> divs? >>> The result should look like this: >>> >>> <div id="container"> >>> >>> <div id="box3">box 3 content</div> >>> <div id="box1">box 1 content</div> >>> <div id="box2">box 2 content</div> >>> <div id="box4">box 4 content</div> >>> >>> </div> >>> >>> How can I do this? I'm new to jQuery, so maybe I've just missed >>> something, >>> but currently I just can't figure that one out. >>> >> $('#box3').prependTo('#container') >> >> As long as you don't clone the node, inserting it elsewhere will move >> it. You may want to aslo check insertBefore, insertAfter, >> prependTo and >> appendTo. >> >> -- >> Jörn Zaefferer >> >> http://bassistance.de _______________________________________________ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/