- Effect
- Object Summary
- Constructor
- Methods
- Effect.dimensionClip(elm,arParams,fncNextEffect)
- Effect.dimensionChange(elm,arParams,fncNextEffect,_blnNoOverFlow,_strEffectName)
- Effect.positionChange(elm,arParams,fncNextEffect)
- Effect.fontZoom(elm,arParams,fncNextEffect)
- Effect.alphaFade(elm,arParams,fncNextEffect)
- Effect.colorFade(elm,strAttribute,arParams,fncNextEffect)
- Effect.isInProgress(elm,strEffectName,strAttribute)
- See Also
- Usage Examples
|
(extends Object)
Object Summary
This object is used to add shiny AJAX DHTML effects to s@rdalya.
The object is currently is in its infancy and it only supports colorFade method.
But there will be much more effects in the next release.
Examine the usage examples, to see how Effect makes dead easy to add, combine and inspect effects.
Constructor
This object does not have a constructor. It is statically accessed.
Methods
Effect.dimensionClip(elm,arParams,fncNextEffect)
comments
Changes the dimension of the object. The contents will be clipped if they cannot fit to the new dimensions.
paramters
elm - The element to apply effect, or its id.
arParams -
The parameters collection can have several forms:
- [Dimension begin,Dimension end]; where begin and end give the initial and final (width,height) pairs as a Dimension object.
- [null,Dimension end]; the begin Dimension will be defaulted to current dimension of the object.
- [null,null]; this can be used to reverse the effect. Begin dimension is current dimension, and end dimension is the original dimension before the last dimensionClip effect has been applied.
The array may have a third variable including advanced options like
[b,e,{step:44,interval:26,exp:2.75}]
where step is the number of incremental steps, interval is the time between two steps (in milliseconds) and exp is the exponential smoothing factor.
The default values are 33, 32 and 1.618 respectively, which give a smooth transition that takes more or less one second.
You can play around with these values to better suit the Effect to your needs.
fncNextEffect - If given, this method is evaluated after the effect finishes. This may be used for either diagnostic purposes, or to bind the current effect to another effect through an anonymous function call.
Effect.dimensionChange(elm,arParams,fncNextEffect,_blnNoOverFlow,_strEffectName)
comments
Changes the dimension of the object. The contents will be not be clipped.
paramters
elm - The element to apply effect, or its id.
arParams -
The parameters collection can have several forms:
- [Dimension begin,Dimension end]; where begin and end give the initial and final (width,height) pairs as a Dimension object.
- [null,Dimension end]; the begin Dimension will be defaulted to current dimension of the object.
- [null,null]; this can be used to reverse the effect. Begin dimension is current dimension, and end dimension is the original dimension before the last dimensionChange effect has been applied.
The array may have a third variable including advanced options like
[b,e,{step:44,interval:26,exp:2.75}]
where step is the number of incremental steps, interval is the time between two steps (in milliseconds) and exp is the exponential smoothing factor.
The default values are 33, 32 and 1.618 respectively, which give a smooth transition that takes more or less one second.
fncNextEffect - If given, this method is evaluated after the effect finishes. This may be used for either diagnostic purposes, or to bind the current effect to another effect through an anonymous function call.
Effect.positionChange(elm,arParams,fncNextEffect)
comments
Changes the coordinates of the object.
paramters
elm - The element to apply effect, or its id.
arParams -
The parameters collection can have several forms:
- [Dimension begin,Dimension end]; where begin and end give the initial and final (top,left) coordinates as a Dimension object.
- [null,Dimension end]; the begin Dimension will be defaulted to current (top,left) of the object.
- [null,null]; this can be used to reverse the effect. Begin dimension is current (top,left) position, and end dimension is the original position before the last positionChange effect has been applied.
The array may have a third variable including advanced options like
[b,e,{step:44,interval:26,exp:2.75}]
where step is the number of incremental steps, interval is the time between two steps (in milliseconds) and exp is the exponential smoothing factor.
The default values are 33, 32 and 1.618 respectively, which give a smooth transition that takes more or less one second.
fncNextEffect - If given, this method is evaluated after the effect finishes. This may be used for either diagnostic purposes, or to bind the current effect to another effect through an anonymous function call.
Effect.fontZoom(elm,arParams,fncNextEffect)
comments
Changes the font size of the object.
paramters
elm - The element to apply effect, or its id.
arParams -
The parameters collection can have several forms:
- [begin,end]; where begin and end give the initial and final font sizes in percent.
- [null,end]; the begin font size will be defaulted to 100%.
- [null,null]; this can be used to reverse the effect. Begin font size is current font size, and end font size is 100%.
The array may have a third variable including advanced options like
[b,e,{step:44,interval:26,exp:2.75}]
where step is the number of incremental steps, interval is the time between two steps (in milliseconds) and exp is the exponential smoothing factor.
The default values are 33, 32 and 1.618 respectively, which give a smooth transition that takes more or less one second.
fncNextEffect - If given, this method is evaluated after the effect finishes. This may be used for either diagnostic purposes, or to bind the current effect to another effect through an anonymous function call.
Effect.alphaFade(elm,arParams,fncNextEffect)
comments
Changes the opacity of the object.
paramters
elm - The element to apply effect, or its id.
arParams -
The parameters collection can have several forms:
- [begin,end]; where begin and end give the initial and final opacity values.
- [null,end]; the begin will be defaulted to current opacity of the object.
- [null,null]; this can be used to reverse the effect. begin is current opacity, and end is the original opacity before the last alphaFade effect has been applied.
The array may have a third variable including advanced options like
[b,e,{step:44,interval:26,exp:2.75}]
where step is the number of incremental steps, interval is the time between two steps (in milliseconds) and exp is the exponential smoothing factor.
The default values are 33, 32 and 1.618 respectively, which give a smooth transition that takes more or less one second.
fncNextEffect - If given, this method is evaluated after the effect finishes. This may be used for either diagnostic purposes, or to bind the current effect to another effect through an anonymous function call.
fncNextEffect - If given, this method is evaluated after the effect finishes. This may be used for either diagnostic purposes, or to bind the current effect to another effect through an anonymous function call.
Effect.colorFade(elm,strAttribute,arParams,fncNextEffect)
comments
Changes the color (foreground or background) of the object.
parameters
elm - The element to apply effect, or its id.
strAttribute - The CSS attribute to apply effect (such as backgroundColor)
arParams -
The parameters collection can have two forms.
- Either An Array of colors like ["AACCFF","FF99CC"].
- Or [null,"FF99CC"] (the initial color will be defaulted to the current)
- Or [null,null] (to reverse the former effect).
- Or an array of colors plus another "associative array" to set advanced parameters
like
[b,e,{step:44,interval:26,exp:2.75}]
where step is the number of incremental steps, interval is the time between two steps (in milliseconds) and exp is the exponential smoothing factor.
The default values are 33, 32 and 1.618 respectively, which give a smooth transition that takes more or less one second.
You can play around with these values to better suit the Effect to your needs.
fncNextEffect - If given, this method is evaluated after the effect finishes. This may be used for either diagnostic purposes, or to bind the current effect to another effect through an anonymous function call.
Effect.isInProgress(elm,strEffectName,strAttribute)
parameters
elm - The element reference or id of element.
strEffectName - The camel cased effect name (like "colorFade").
strAttribute - The attribute that the Effect is applied to.
returns
true if the Effect is still in progress, false otherwise.
comments
Checks whether or not an Effect is still in progress.
See Also
Incrementer
Usage Examples
Comments (0)
You don't have permission to comment on this page.