Fx.Sort

Thursday, July 19th, 2007 @ 3:47 pm | filed under: Examples, Visual Effects

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.

  1. (0) stuff
  2. (1) more stuff
    really
  3. (2) still more stuff
  4. (3) loads o stuff
  5. (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)

3 Responses to “Fx.Sort”

  1. rails blog » Blog Archive » [Rails-spinoffs] FX.sort in Scriptaculous Says:

    [...] http://clientside.cnet.com/code-snippets/visual-effects/fxsort/ [...]

  2. rails blog » Blog Archive » [Rails-spinoffs] Re: FX.sort in Scriptaculous Says:

    [...] 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 [...]

  3. GSIY … Ruby-Rails Portal Says:

    [...] 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 [...]