11/30/2022 0 Comments Javascript mouse coordinates canvas![]() ![]() It returns an object with x and y for the mouse positions. X = parseInt(x) + parseInt(elm.offsetLeft) Just call it from your event with the event and canvas as arguments. offsetTop to y and set elm to its offsetParent if not then add current elm’s offsetLeft to x Y = elm.offsetTop // set y to elm’s offsetTopĮlm = elm.offsetParent // set elm to its offsetParent
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |