Forum Moderators: open
<div id="myCanvas" style="position:relative;height:50%;width:50%;"></div>
<script type="text/javascript" src="wz_jsgraphics.js"></script>
<script type="text/javascript">
var jg = new jsGraphics("myCanvas");
function myDrawFunction()
{
jg.setColor("#00ff00");
jg.fillRect(110, 120, 30, 60);
jg.paint();
}
myDrawFunction();
</script>
<html>
<head>
<title>New Page 1</title>
</head>
<input type="button" value="Button" name="B3" onclick="myDrawFunction()"></p>
</body>
</html>
<div id="myCanvas" style="position:relative;height:50%;width:50%;">HELLO</div>
For some reason it would not draw anything on the layer until I have some text placed on the layer. Is there a way round this? Rather than having 'HELLO' or whatever on my page?
I have set the colour of this text to white so I cant be seen but even so would like to know why it would not work first time.
Thaanks