Functions / jc
jc(selector, [map])
jc(string '#id')
jc(string '.name')
jc(object map)
jc(string selector, object map)

jc(string '#id')
return: object
Select jCanvaScript object with same id.
Code
<script type="text/javascript">
	function start_1(idCanvas)
	{
		jc('#myCircle_1')
			.color('#FF00FF');
	}
	function stop_1(idCanvas)
	{
		jc('#myCircle_1')
			.color('#00FFFF');
	}
	function onload_1(idCanvas)
	{
		jc.start(idCanvas,true);
		jc.circle(80,80,40,'#00FFFF',1)
			.id('myCircle_1');
	}
</script>
<canvas id="canvas_1" width="250px" height="265px">
</canvas>
View
jc(string '.name')
return: group of objects
Selects group of jCanvaScript objects with same name.
Code
<script type="text/javascript">
	function start_2(idCanvas)
	{
		jc('.myCircles_2')
			.color('#FF00FF');
	}
	function stop_2(idCanvas)
	{
		jc('.myCircles_2')
			.color('#00FFFF');
	}
	function onload_2(idCanvas)
	{
		jc.start(idCanvas,true);
		jc.circle(45,80,40,'#00FFFF',1)
			.name('myCircles_2');
		jc.circle(90,80,40,'#00FFFF',1)
			.name('myCircles_2');
		jc.circle(135,80,40,'#00FFFF',1)
	}
</script>
<canvas id="canvas_2" width="250px" height="265px">
</canvas>
View
jc(object map)
return: group of objects
Selects group of jCanvaScript objects by canvas and layer, defined by the map.
Code
<script type="text/javascript">
	function start_3(idCanvas)
	{
		jc({canvas:idCanvas+'1',layer:'myLayer_3'})
			.color('#FF00FF');
	}
	function stop_3(idCanvas)
	{
		jc({canvas:idCanvas+'1',layer:'myLayer_3'})
			.color('#00FFFF');
	}
	function onload_3(idCanvas)
	{
		jc.start(idCanvas+'1',25);
		jc.circle(45,60,40,'#00FFFF',1)
			.layer('myLayer_3');
		jc.circle(135,60,40,'#00FFFF',1)
			.layer('myLayer_3');
		jc.circle(185,60,40,'#00FFFF',1);
		jc.start(idCanvas+2,25);
		jc.circle(90,80,40,'#00FFFF',1);
	}
</script>
<style>
.canvas{
	border:1px solid #ccc;
}
</style>
<canvas id="canvas_31" class="canvas" width="250px" height="130px">
</canvas>
<canvas id="canvas_32" class="canvas" width="250px" height="130px">
</canvas>
View
jc(string selector, object map)
return: object or group
If you have many canvases and layers, then you can use this function for the fast selection.
Code
<script type="text/javascript">
	function start_4(idCanvas)
	{
		jc('#myCircle_4',{canvas:idCanvas+'1',layer:'myLayer_4'})
			.color('#FF00FF');
	}
	function stop_4(idCanvas)
	{
		jc({canvas:idCanvas+'1',layer:'myLayer_4'})
			.color('#00FFFF');
	}
	function onload_4(idCanvas)
	{
		jc.start(idCanvas+'1',25);
		jc.circle(45,60,40,'#00FFFF',1)
			.id('myCircle_4')
			.layer('myLayer_4');
		jc.circle(135,60,40,'#00FFFF',1)
			.layer('myLayer_4');
		jc.circle(185,60,40,'#00FFFF',1);
		jc.start(idCanvas+'2',25);
		jc.circle(90,80,40,'#00FFFF',1);
	}
</script>
<style>
.canvas{
	border:1px solid #ccc;
}
</style>
<canvas id="canvas_41" class="canvas" width="250px" height="130px">
</canvas>
<canvas id="canvas_42" class="canvas" width="250px" height="130px">
</canvas>
View