curve-source.mustache revision 1f08a8488664773a7d96fa3a043a639692d2a5cb
<span id="demo"></span>
<script type="text/javascript">
YUI().use('anim', function(Y) {
var node = Y.one('#demo');
var anim = new Y.Anim({
node: node,
duration: 1.5,
easing: Y.Easing.easeOut
});
var randomCurve = function(end) {
var points = [],
n = 3,
winWidth = node.get('winWidth'),
winHeight = node.get('winHeight');
for (var i = 0; i < n; ++i) {
Math.floor(Math.random() * winWidth),
Math.floor(Math.random() * winHeight)
]);
}
if (end) {
points.push(end);
}
return points;
};
var onClick = function(e) {
anim.set('to', {
});
anim.run();
};
Y.one('document').on('click', onClick);
});
</script>