Reorders a group of items with a transition.
new Fx.Sort(elements[, options]);
var mysort = new Fx.Sort($$('ul li'), { transition: Fx.Transitions.Back.easeInOut, duration: 1000 }); mysort.sort([2,0,1]); //a specific order mysort.forward(); //forward (the original) order
Retrieves the current sort order.
mySort.getCurrentOrder();
Rearranges the items visually into a new order.
mySort.sort(order);
mySort.sort([2,1,0]); //reverse
Rearranges the DOM to the current sort order.
mySort.rearrangeDOM(order); //order is optional
mySort.rearrangeDOM([1,3,2,0]); mySort.rearrangeDOM(); //use current sort
Arrange the items in the original order (0,1,2,3,etc).
mySort.forward();
Arrange the items in the original order reversed (...3,2,1,0).
mySort.forward();
Arrange the items in the current order reversed.
mySort.reverse();
Sort by the order specified in a collection of elements; elements must be an array (collection) of the elements within the elements specified at instantiation.
mySort.sortByElements(elements);
var mySort = new Fx.Sort($$('ul li')); mySort.sortByElements([$('li3'), $('li2'), $('li1'), $('li0')]);
Swaps the position of one item with another.
mySort.swap(element_1, element_2);
var mySort = new Fx.Sort($$('ul li')); mySort.swap($('#li3'), $('#li0')); //OR mySort.swap(3, 0);
This documentation is released under a Attribution-NonCommercial-ShareAlike 3.0 License.