HTML5 Canvas 2D Library
 

select Library Method

Short Description: Select elements of set based on boolean function

Signature: m.select (f,d)
Class: taccglMulti Class
 

Uses function f to select elements from the current animation set. f must be a javascript function (a,i,d,m) expecting 4 parameters and having a boolean result. select returns a new set of transition containing all those transitions from the original set for which the function f returned true. The function f receives as a the transition to process. i is an integer giving the ordinal number of a in the current animation set. As d the parameter d of the mp method is passed through. m is the current animation set.

Examples

var a=taccgl.mTagName("a").paint().
select(function(a){return a.x<300}).bgColor("red"). hide(). visAtEnd(). start();
RUN
Next Page:taccglMulti.selModulo - Select elements based on modulo operation
Previous Page: taccglMulti.mp - Perform function on all elements of set