185
rated 0 times
[
189]
[
4]
/ answers: 1 / hits: 30012
/ 13 Years ago, wed, october 19, 2011, 12:00:00
In HTML5 Canvas what is offsetTop and offsetLeft ?
I'm trying to get the X and Y of a a mouse click event. I know I can get that through:
mycanvas.onclick = function (evt) {
var offX = evt.layerX - mycanvas.offsetLeft;
var offY = evt.layerY - mycanvas.offsetTop;
}
but what is offsetLeft and offsetTop? and what is LayerX and LayerY ?
More From » html