Team:Acton-BoxboroughRHS/Simulations
From 2014hs.igem.org
(Difference between revisions)
Line 123: | Line 123: | ||
<p style="font-size:12px;font-family:Arial">Note that this is test JavaScript:</p> | <p style="font-size:12px;font-family:Arial">Note that this is test JavaScript:</p> | ||
<br></br> | <br></br> | ||
- | + | ||
- | + | <canvas id="myCanvas" width="300" height="150" style="border:1px solid #d3d3d3;"> | |
+ | Your browser does not support the HTML5 canvas tag.</canvas> | ||
<script> | <script> | ||
- | var | + | var c=document.getElementById("myCanvas"); |
- | var ctx= | + | var ctx=c.getContext("2d"); |
- | + | ||
- | + | ||
- | + | // Red rectangle | |
ctx.beginPath(); | ctx.beginPath(); | ||
ctx.lineWidth="6" | ctx.lineWidth="6" | ||
ctx.strokeStyle="black"; | ctx.strokeStyle="black"; | ||
- | ctx.rect(0,0, | + | ctx.rect(0,0, 50, 50) |
ctx.stroke(); | ctx.stroke(); | ||
+ | // Green rectangle | ||
+ | ctx.beginPath(); | ||
+ | ctx.lineWidth="4"; | ||
ctx.strokeStyle="green"; | ctx.strokeStyle="green"; | ||
+ | ctx.rect(30,30,50,50); | ||
+ | ctx.stroke(); | ||
+ | |||
+ | // Blue rectangle | ||
ctx.beginPath(); | ctx.beginPath(); | ||
- | ctx. | + | ctx.lineWidth="10"; |
+ | ctx.strokeStyle="blue"; | ||
+ | ctx.rect(50,50,150,80); | ||
ctx.stroke(); | ctx.stroke(); | ||
- | |||
</script> | </script> |
Revision as of 02:00, 26 May 2014
Note that this is test JavaScript:
Message