Animate Text P2
Here is an example with animating text. setTimeout is used for a sequence of animations. I suspect there may be another way to do this within Snap
var s = Snap("#svgout");
var text = 'Here is some dynamic exciting announcement';
// inspired from http://codepen.io/GreenSock/pen/AGzci
var textArray = text.split(" ");
var len = textArray.length;
var timing = 750;
for( var index=0; index < len; index++ ) {
(function() {
var svgTextElement = s.text(350,100, textArray[index]).attr({ fontSize: '120px', opacity: 0, "text-anchor": "middle" });
setTimeout( function() {
Snap.animate( 0, 1, function( value ) {
//svgTextElement.transform('s' + value ); // Animate by transform
svgTextElement.attr({ 'font-size': value * 100, opacity: value }); // Animate by font-size ?
}, timing, mina.bounce, function() { svgTextElement.remove() } );
}
,index * timing)
}());
};