Monthly Archives: March 2014

Canvas (HTML 5) Mouse Position

Want to know the position of the mouse pointer within your <canvas> element? Use jQuery? This code works in IE, Firefox, and Chrome: $(“#canvas_id”).mousedown(function (event) { var offset_x = event.pageX – $(this).offset().left; var offset_y = event.pageY – $(this).offset().top; // do … Continue reading

Posted in HTML 5, JavaScript, Software | Leave a comment