Created
September 29, 2008 20:56
-
-
Save swannodette/13670 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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