Please turn on JavaScript. To find out how to do this visit the WebWise JavaScript guide.

Simple and powerful animations.

Methods

css

Animates CSS properties of an element.

Synopsis

glow.anim.css(element, duration, spec, opts);

Parameters

element
Type
String | glow.dom.NodeList | Element

Element to animate.

This can be a CSS selector (first match will be used), glow.dom.NodeList (first node will be used), or a DOM element.

duration
Type
Number

Animation duration, in seconds by default.

spec
Type
Object

An object describing the properties to animate.

This object should consist of property names corresponding to the CSS properties you wish to animate, and values which are objects with 'from' and 'to' properties with the values to animate between.

If the 'from' property is absent, the elements current CSS value will be used instead.

See the spec example below for more information.

opts
Type
Object

Optional options object.

tween

The way the value moves through time. See glow.tweens.

Type
Function
Default
linear tween
Optional
Yes
useSeconds

Specifies whether duration should be in seconds rather than frames.

Type
Boolean
Default
true
Optional
Yes

Returns

Example

// an example of an spec object
{
  "height": {from: "10px", to: "100px"},
  "width": {to: "100px"},
  "font-size": {from: "0.5em", to: "1.3em"}
}
// animate an elements height and opacity to 0 from current values over 1 second
glow.anim.css("#myElement", 1, {
  "height" : {to:0},
  "opacity" : {to:0}
}).start();

Classes

Animation

Controls modifying values over time.

Timeline

Synchronises and chains animations.

Documentation generated by JsDoc Toolkit 2.1.0 on Mon Jul 06 2009 11:46:05 GMT+0100 (BST)

BBC © 2014 The BBC is not responsible for the content of external sites. Read more.

This page is best viewed in an up-to-date web browser with style sheets (CSS) enabled. While you will be able to view the content of this page in your current browser, you will not be able to get the full visual experience. Please consider upgrading your browser software or enabling style sheets (CSS) if you are able to do so.