forked from madrobby/scriptaculous
-
Notifications
You must be signed in to change notification settings - Fork 0
List Morph Demo
joe-loco edited this page Sep 12, 2010
·
10 revisions
Demos > List Morph Demo
This is a demonstration of how Effect.Morph can be used to indicate a list reordering to the user. Click anywhere on the list to initiate a random reorder.
Lorem
ipsum
dolor
sit
amet
Array.prototype.shuffle = function() {
return this.sortBy(Math.random);
};
(function() {
function foo() {
$('scripty_morph_demo').select('div').shuffle().each(function(e, i) {
e.morph('top:' + i*e.getHeight() + 'px', { duration: 0.4 });
});
}
$('scripty_morph_demo').observe('click', foo);
foo();
})();