Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

javascript onclick select coordinates

var x;
var y;
if (e.pageX || e.pageY) { 
  x = e.pageX;
  y = e.pageY;
}
else { 
  x = e.clientX + document.body.scrollLeft + document.documentElement.scrollLeft; 
  y = e.clientY + document.body.scrollTop + document.documentElement.scrollTop; 
} 
x -= gCanvasElement.offsetLeft;
y -= gCanvasElement.offsetTop;
Comment

PREVIOUS NEXT
Code Example
Javascript :: js php number format 
Javascript :: discord.js get first mention 
Javascript :: convert days into year month 
Javascript :: fetch post headers 
Javascript :: nodejs get param cli 
Javascript :: add onclick event jquery button 
Javascript :: make multiple function calls at the same time js async 
Javascript :: discord.js clean content 
Javascript :: page redirect after load 
Javascript :: joi validation 
Javascript :: toggle state react 
Javascript :: laravel using react 
Javascript :: Function used to reload the portion of a page using javascript 
Javascript :: sequelize findone 
Javascript :: regular expressions password contains number 
Javascript :: javascript cehck if array is empty 
Javascript :: element en html and js 
Javascript :: debounchow use input debounce in javascript vue.js 
Javascript :: xlsx to json javascript 
Javascript :: jquery open page in new tab 
Javascript :: hex string to int javascript 
Javascript :: formik validator in react 
Javascript :: es ignore 
Javascript :: json array 
Javascript :: localdatetime json 
Javascript :: count json objects 
Javascript :: javascript dir 
Javascript :: smooth scroll mouse wheel javascript 
Javascript :: reload react native app 
Javascript :: ubuntu 18.04 nodejs insatll 
ADD CONTENT
Topic
Content
Source link
Name
6+3 =