I agree, this effect is done in all of these JS libs. 
I've been using mooTools lately, but that's just my preference.  IMO, 
Script.aculo.us seems to cater solely to RoR(at least they did, haven't looked 
lately)

-----Original Message-----
From: Robertson-Ravo, Neil (RX) [mailto:[EMAIL PROTECTED] 
Sent: Thursday, March 22, 2007 2:23 PM
To: CF-Talk
Subject: Re: OT JS - Moving elements in page

What about using Prototype / Script.Aculo.Us?

(or on all the other JS/DHTML libs)





"This e-mail is from Reed Exhibitions (Gateway House, 28 The Quadrant, 
Richmond, Surrey, TW9 1DN, United Kingdom), a division of Reed Business, 
Registered in England, Number 678540.  It contains information which is 
confidential and may also be privileged.  It is for the exclusive use of the 
intended recipient(s).  If you are not the intended recipient(s) please note 
that any form of distribution, copying or use of this communication or the 
information in it is strictly prohibited and may be unlawful.  If you have 
received this communication in error please return it to the sender or call our 
switchboard on +44 (0) 20 89107910.  The opinions expressed within this 
communication are not necessarily those expressed by Reed Exhibitions." 
Visit our website at http://www.reedexpo.com

-----Original Message-----
From: Brian Swartzfager
To: CF-Talk
Sent: Thu Mar 22 18:08:26 2007
Subject: Re: OT JS - Moving elements in page

>Anyone have any pointers or examples of DHTML ordering? Will it be a 
>case
of
>deleting and reinserting elements where needed?

I messed around with doing something similar a lot lately, and I came up with 
two different approaches:

If the elements you want to "move" only contain one or two simple elements 
(like text or hyperlinks), you can simply swap the text or values of those 
child elements instead of actually moving the position of the elements in the 
DOM hierarchy.  I actually just made a UI tool that does just that in the 
Downloads box on the right-hand side of my blog (there's a working example on 
that download page as well):

http://www.swartzfager.org/blog

......the purpose of the tool is really to _record_ the rearrangement of the 
elements (usually the elements of a list or table), not just visually rearrange 
them, but the JS techniques are the same.  It works in all the major browsers 
(including Safari).

The other approach is more like what you did with your reorder.html:  I had to 
build a bookmark portlet for our portal system, and I wanted users to not only 
be able to nest bookmarks and folders, but to be able to reorder two folders at 
the same level in the hierarchy...which meant moving all of the bookmarks and 
folders contained in the folder.  I ended up writing some functions that would 
clone the elements, remove the original elements, and then place the clones in 
the proper position of the document by figuring out which page element the 
clone should appear before and then using the insertBefore method.

It works in Netscape, IE, FireFox, and Opera, but not in Safari:  one of the 
functions involves reassigning element ids and Safari doesn't seem to like that 
for whatever reason.

If you're interested in seeing the code for the second approach, I could 
probably clean it up for public consumption.

--
Brian Swartzfager
[EMAIL PROTECTED]
http://www.swartzfager.org/blog





~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Upgrade to Adobe ColdFusion MX7
Experience Flex 2 & MX7 integration & create powerful cross-platform RIAs
http://www.adobe.com/products/coldfusion/flex2/?sdid=RVJQ 

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:273408
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4

Reply via email to