Functions / canvas
canvas(idCanvas)
canvas( )
canvas(string idCanvas)

canvas( )
return: string idCanvas
Allows to get id of a canvas of jCanvaScript object.
Code
<script type="text/javascript">
	function start_1(idCanvas)
	{
		alert(jc('#myCircle_11')
			.canvas());
	}
	function stop_1(idCanvas)
	{
		alert(jc('#myCircle_12')
			.canvas());
	}
	function onload_1(idCanvas)
	{
		jc.start(idCanvas+1,25);
		jc.circle(45,60,40,'#00FFFF',1)
			.id('myCircle_11');
		jc.start(idCanvas+2,25);
		jc.circle(90,80,40,'#00FFFF',1)
			.id('myCircle_12');
	}
</script>
<style>
.canvas{
	border:1px solid #ccc;
}
</style>
<canvas id="canvas_11" class="canvas" width="250px" height="130px">
</canvas>
<canvas id="canvas_12" class="canvas" width="250px" height="130px">
</canvas>
View
canvas(string idCanvas)
return: object
The method allows to place jCanvaScript object in a canvas with some id.
Code
<script type="text/javascript">
	function start_2(idCanvas)
	{
		jc('#myCircle_21')
			.canvas('canvas_22');
	}
	function stop_2(idCanvas)
	{
		jc('#myCircle_21')
			.canvas('canvas_21');
	}
	function onload_2(idCanvas)
	{
		jc.start(idCanvas+1,25);
		jc.circle(45,60,40,'#00FFFF',1)
			.id('myCircle_21');
		jc.start(idCanvas+2,25);
		jc.circle(90,80,40,'#00FFFF',1)
			.id('myCircle_22');
	}
</script>
<style>
.canvas{
	border:1px solid #ccc;
}
</style>
<canvas id="canvas_21" class="canvas" width="250px" height="130px">
</canvas>
<canvas id="canvas_22" class="canvas" width="250px" height="130px">
</canvas>
View