Fx.Sort
I got a little bored last night and banged this out. A little 2K effect for resorting elements with an effect. More info in the wiki, download in the svn.
- (0) stuff
- (1) more stuff
really - (2) still more stuff
- (3) loads o stuff
- (4) blah
blah
blah
one
two
three
four
five
forward | backward | 3,4,2,0,1 | 2,3,0,1,4
:
:
In addition to specifying a new order using numbers, there are some other methods.
vert.forward(); //0,1,2,3,etc.
vert.backward(); //3,2,1,0
vert.swap(3,1);
vert.reverse(); //reverses the current order
Finally, you can sort a list and then rearrange the DOM so that the new sort is reflected in the body of the document.
vert.backward().chain(vert.rearrangeDOM.bind(vert));
No TweetBacks yet. (Be the first to Tweet this post)
Follow @clientcide on twitter to get notified of new posts.
To follow me personally on twitter, follow @anutron.
September 14th, 2007 at 4:01 pm
[...] http://clientside.cnet.com/code-snippets/visual-effects/fxsort/ [...]
September 17th, 2007 at 12:00 am
[...] On Sep 14, 3:12 pm, Peter De Berdt wrote: > On 14 Sep 2007, at 19:07, meekish wrote: > > >http://clientside.cnet.com/code-snippets/visual-effects/fxsort/ > > > Has anything similar been created for Scriptaculous? > > Let’s hope someone has done it decently then, this one doesn’t work > in Safari > > Best regards > > Peter De Berdt [...]
September 18th, 2007 at 11:46 am
[...] On Sep 14, 3:12 pm, Peter De Berdt <peter.de.be…@…> wrote: > On 14 Sep 2007, at 19:07, meekish wrote: > > >http://clientside.cnet.com/code-snippets/visual-effects/fxsort/ > > > Has anything similar been created for Scriptaculous? > > Let’s hope someone has done it decently then, this one doesn’t work > in Safari > > Best regards > > Peter De Berdt [...]