window.addEvent('load', function(){
var shuffle = new shuffleText('stext', { duration: 3000 });
shuffle.start();
var shufflebutton = new shuffleText('sbutton', {
duration: 2000,
onStart: function(){
$('status').set('text','shuffling started');
},
onComplete: function(){
$('status').set('text','shuffling completed');
}
});
$('sbutton').addEvent('mouseenter', function(){
shufflebutton.start();
});
$$('a').each(function(el){
var shuffle = new shuffleText(el);
el.addEvent('mouseenter', function(){
shuffle.start();
});
});
});
shuffleText.js (2Kb) (requires Mootools 1.2b2 with Class.Extras, Selectors and Element.Event)
onStart and onComplete events.onStart and onComplete events.Element.shuffleTextCoded by Chee Aun