Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

svg clientx

var pt = svg.createSVGPoint();  // Created once for document

function alert_coords(evt) {
    pt.x = evt.clientX;
    pt.y = evt.clientY;

    // The cursor point, translated into svg coordinates
    var cursorpt =  pt.matrixTransform(svg.getScreenCTM().inverse());
    console.log("(" + cursorpt.x + ", " + cursorpt.y + ")");
}
Comment

svg clientx

function clicked(evt){
    var e = evt.target;
    var dim = e.getBoundingClientRect();
    var x = evt.clientX - dim.left;
    var y = evt.clientY - dim.top;
    alert("x: "+x+" y:"+y);
}  
Comment

PREVIOUS NEXT
Code Example
Javascript :: summernote mentions ajax 
Javascript :: Webpack ReferenceError: process is not defined #871 electron vue 
Javascript :: import and export data in mongodb 
Javascript :: detect localstorage limit 
Javascript :: algolia docs react instant search 
Javascript :: npm redis for js 
Javascript :: error handling in node js 
Javascript :: javascript eingabe in inputfielder übernehmen 
Javascript :: on enter to tab javascript 
Javascript :: jest Cross origin http://localhost forbidden 
Javascript :: react fetch data in for loop 
Javascript :: javascript select2 sortable 
Javascript :: print js css not working 
Javascript :: moment.js get time from now 
Javascript :: insert a string in another js 
Javascript :: sum function in javascript 
Javascript :: selectores de jquery 
Javascript :: jquery select 
Javascript :: of rxjs 
Javascript :: remove duplicates in json in flutter 
Javascript :: print stuff in console javascript 
Javascript :: js filter text 
Javascript :: javascript copy clipboard 
Javascript :: simple search filter for table html 
Javascript :: webpack vue global variable 
Javascript :: sidenavbar js 
Javascript :: find key in nested json object 
Javascript :: how to decode jwt token at frontend 
Javascript :: queryselector for jquery 
Javascript :: visual studio code json to one line 
ADD CONTENT
Topic
Content
Source link
Name
8+1 =