What are the events on the canvas object that I can handle. In particular, I am looking for a mouse event (either down, or up, etc.) that will give me x and y in the canvas.
Here is a little [ Demo ] .
var canvas = document.getElementById("canvas"); canvas.onclick = function(e) { // mouse coordinates relative // to the canvas element var position = canvas.getBoundingClientRect(); var click = { x: e.clientX - position.left, y: e.clientY - position.top }; };
DOM , () DOM. canvas - DOM, , , - . xy, , click canvas, x, y x, y canvas.
canvas
Source: https://habr.com/ru/post/1776026/More articles:Non-blocking io webserver / framework for java - javahttps://translate.googleusercontent.com/translate_c?depth=1&pto=aue&rurl=translate.google.com&sl=ru&sp=nmt4&tl=en&u=https://fooobar.com/questions/1776022/add-10-minutes-to-730am-php&usg=ALkJrhiv0z5V0NyTrZGiaEUJFWkEf28hfwAre there any free php scanners? - phpнапишите этот xml в С# - c#Undefined link for libpq functions - linkerhttps://translate.googleusercontent.com/translate_c?depth=1&pto=aue&rurl=translate.google.com&sl=ru&sp=nmt4&tl=en&u=https://fooobar.com/questions/1776027/is-there-a-function-in-emacs-to-search-the-filesystem-for-a-file-by-its-name&usg=ALkJrhi3a2AJYjWuzWXkpsKs-W_BV3K6nwGetting java.lang.ClassNotFoundException: org.jsoup.Jsoup - javaИспользование PHP Simple HTML DOM Parser для статуса приложения Google - phpA sorting algorithm sorts a height of 1.14 billion people! - sortingDynamically create Tkinter buttons - pythonAll Articles