Library
Functions / name
name(name)
Allows to set name to jCanvaScript objects in order to get groups of them with '.name' selector.
name(string name)
return: object
Code
<script type="text/javascript">
function start_1(idCanvas)
{
jc('.myCircles_1')
.animate({rotate:
{angle:360,x:150,y:80}},
3800,{fn:'elastic'});
}
function stop_1(idCanvas)
{
jc('.myCircles_1')
.animate({rotate:
{angle:-30,x:150,y:80}},
800);
}
function onload_1(idCanvas)
{
jc.start(idCanvas,true);
jc.circle(40,80,40,'#00FFFF',1)
.name('myCircles_1');
jc.circle(90,80,40,'#FFFF00',1)
.name('myCircles_1');
jc.circle(150,80,40,'#FF00FF',1)
.name('myCircles_1');
}
</script>
<canvas id="canvas_1" width="250px" height="265px">
</canvas>
View
name( )
return: string name
You can get name of jCnavaScript object with that.
Code
<script type="text/javascript">
function start_2(idCanvas)
{
alert(jc('#myCircle_2').name());
}
function stop_2(idCanvas)
{
jc('#myCircle_2')
.name('anotherName_2');
}
function onload_2(idCanvas)
{
jc.start(idCanvas,true);
jc.circle(40,40,40,'#00FFFF',1)
.name('myCircles_2')
.id('myCircle_2');
}
</script>
<canvas id="canvas_2" width="250px" height="265px">
</canvas>
View