<canvas id="myCanvas" width="578" height="400"></canvas>
<script>
var canvas = document.getElementById('myCanvas');
var context = canvas.getContext('2d');
var imageObj = new Image();
imageObj.onload = function() {
context.drawImage(imageObj, 128, 128);
};
imageObj.src = 'http://xxx/yyy/zzz.jpg';
</script>
How can I get notified or hooked with an event handler, when the imageObj, the child of the canvas object (not the canvas) is clicked?
Aucun commentaire:
Enregistrer un commentaire