The SineWave Object will slide the layer along a sine wave path.
Initialization:
objectName.sinewave = new SineWave("objectName","sinewave")
Example:
mylayer = new DynLayer("mylayerDiv") mylayer.sinewave = new SineWave("mylayer","sinewave")
The play() Method:
The play() method begins the sine wave:
objectName.sinewave.play(amplitude,wavelength,angleinc,angle,cycles,direction,speed,fn)
Examples:
mylayer.sinewave.play(60,200,15,0,2,1,20)
The pause() and stop() Methods:
Work the same as in the circle() method.
Demo:
View sinewave1.html for a sinewave example.
Download: sinewave.js
View Source: sinewave.js
Home | Next Lesson: Path Animation |