Jim R Posted February 5, 2011 Share Posted February 5, 2011 It might be called object mapping, but I'm not sure. Basically, I'm wanting somewhat of a GUI where the User clicks on an area of the page, and the location of the click is noted (for a database). From there it can be given a value based on whether or not a right click was used vs a left click. Quote Link to comment https://forums.phpfreaks.com/topic/226762-not-sure-where-to-post-this-or-even-what-its-specifically-called/ Share on other sites More sharing options...
sunfighter Posted February 5, 2011 Share Posted February 5, 2011 Here's something to get you started i'd use onmouseclick <html> <head> <title>Get Mouse Coordinates</title> <script language=”javascript”> var divObj; /** * capture mousemove event, this statement will cause browser to * call getMouseCoordites function each time mouse moves */ document.onmousemove=getMouseCoordinates; /** *identify which event is supported * Based on that collect pageX and pageY properties of the event object * pageX and pageY gets the X and Y cursor coordinates */ function getMouseCoordinates(event) { ev = event || window.event; divObj.innerHTML = “Mouse X:”+ev.pageX + ” Mouse Y:”+ev.pageY; } //assign the mouseCoord Object to divObj function loadDiv() { divObj = document.getElementById(“mouseCoord”); } </script> </head> <body onLoad=”loadDiv()”> <div id=”mouseCoord”>Mouse Coordinates position will be displayed here. </div> </body> </html> Quote Link to comment https://forums.phpfreaks.com/topic/226762-not-sure-where-to-post-this-or-even-what-its-specifically-called/#findComment-1170432 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.