Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 3 Next »

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

Parameters:

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

Example:

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);
});
  • No labels