Skip to content

Instantly share code, notes, and snippets.

@swannodette
Created September 29, 2008 20:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save swannodette/13670 to your computer and use it in GitHub Desktop.
Save swannodette/13670 to your computer and use it in GitHub Desktop.
var Slider=new Class({
Implements:Chain,
initialize: function (element){
this.element = $(element);
},
slide: function(prop, pos0, pos1){
this.element.set('tween', {
duration : 2000,
transition : Fx.Transitions.Cubic.easeInOut
});
this.element.tween(prop, [pos0, pos1]);
}
});
function init()
{
var mySlider=new Slider($('quad'));
mySlider.chain(
mySlider.slide('left', 0, 400),
mySlider.slide('top', 0, 200),
mySlider.slide('left', 400, 0),
mySlider.slide('top', 200, 0)
);
mySlider.callChain();
mySlider.callChain().delay(2000,mySlider);
}
window.addEvent('domready', init);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment