getMouseX( event )

This function returns the X coordinate position of the mouse based on a mouse event object.


  • event – the event object captured by an event such as onmousemove, onclick, or onmouseover


The code below assigns an event that reports mouse coordinates as the user hovers the mouse cursor over an image element. It assumes that an image element with the id of “myImage” and an output field with the id of “MouseCoordinates” have been created in the Profound UI designer.

addEvent(getObj("myImage"), "mousemove", function(event) { getObj("MouseCoordinates").innerHTML = getMouseX(event) + "," + getMouseY(event); });