Functions / focus
focus(fn)
focus(function fn)
focus( )

This functions allows you to set or focus on jCanvaScript objects.
focus(function fn)
return: object
Code
<script type="text/javascript">	
	function onload_1(idCanvas)	
	{	
		jc.start(idCanvas,true);
		jc.circle(100,120,50,'rgba(255,0,0,0.5)',1)
			.click(function(){
				this.focus();
			})
			.focus(function(){
				this.color('rgb(255,0,0)');
			});
	}
</script>
<canvas id="canvas_1" tabIndex="0" width="250px" height="265px">
</canvas>
View
focus( )
return: object
Code
<script type="text/javascript">	
	function start_2(idCanvas)
	{
		jc('#myCircle_2').focus();
	}
	function stop_2(idCanvas)
	{
		jc('#myCircle_2')
			.color('#ff0000');
	}
	function onload_2(idCanvas)	
	{	
		jc.start(idCanvas,true);
		jc.circle(100,120,50,'#ff0000',1)
			.id('myCircle_2')
			.focus(function(){
				var r = Math.floor(Math.random() * (254));
				var g = Math.floor(Math.random() * (254));
				var b = Math.floor(Math.random() * (254));
				this.color('rgb('+r+','+g+','+b+')');
			});
	}
</script>
<canvas id="canvas_2" width="250px" height="265px">
</canvas>
View