Skip to content

Instantly share code, notes, and snippets.

@christophlsa
Created June 28, 2012 08:26
Show Gist options
  • Save christophlsa/3009886 to your computer and use it in GitHub Desktop.
Save christophlsa/3009886 to your computer and use it in GitHub Desktop.
demo for issue caleb531/jcanvas#22
<html>
<head>
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script>
<script type="text/javascript" src="https://raw.github.com/caleb531/jcanvas/master/jcanvas.js"></script>
<script type="text/javascript">
function draw () {
var obj = {
layer: true,
fillStyle: '#00FF00',
name: 'test',
x1: 30, y1: 30,
x2: 60, y2: 30,
x3: 60, y3: 60,
x4: 30, y4: 60,
x5: 30, y5: 30,
mouseover: function (layer) {
// do something
},
mouseout: function (layer) {
// do something
}
};
$('canvas').drawLine(obj);
}
$(document).ready(function() {
draw();
$("canvas").setLayer('test', { fillStyle: '#FF0000' });
$("canvas").drawLayers();
});
</script>
</head>
<body>
<canvas id="uebersicht" width="100" height="100" style="border: 1px solid black"></canvas>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment