Class: 'Animation'

'Animation'

new 'Animation'()

Animation
Source:

Methods

<static> linearEasing()

Linear easing.
Source:
See:

<static> remove(id)

Remove an animation object from the queue. The animation object will be removed by force from the animation queue. This will not check if the animation is finished or not!
Parameters:
Name Type Description
id number Animation object ID.
Source:

<static> sinusoidalEasingInOut()

Sinusoidal easing in and out - accelerating until halfway, then decelerating.
Source:
See:

<static> start(options)

Start an animation.

This methods takes an object that configures the animation object details.

Parameters:
Name Type Description
options object Animation configuration object.
Source:
Example
Core.DomReady.add(function()
{
    // The action function for the animation
    var rainbow = function(easing)
    {
        // Get the body element and calculate nice RGB values
        var body = document.getElementsByTagName('body')[0],
            length = 50 * easing,
            center = 128,
            width = 127,
            thirdOfPi = Math.PI / 3;
            rgb = [ ~~(Math.sin(0.3 * length + 0) * width + center),
                    ~~(Math.sin(0.3 * length + (2 * thirdOfPi)) * width + center),
                    ~~(Math.sin(0.3 * length + (4 * thirdOfPi)) * width + center) ];

        // Set the CSS background color of the body element
        body.style.backgroundColor = 'rgb(' + rgb.join(',') + ')';
    }

    // Animation options for an endless loop
    var options = 
    {
        duration: 23.14159265,
        action: rainbow,
        callback: function(){ Core.Animation.start(options); }
    }
  
    // Start the animation
    Core.Animation.start(options);
});