onmousemove - Mouse Move Script

Activates an event handler when a control receives a mouse movement.

Category

events

Syntax

<xp:eventHandler event="onmousemove" attributes>content</xp:eventHandler>

Usage

For detailed event handler syntax, see eventHandler - Event Handler (property).

Examples

This button has client handlers for the onmousmove and onmouseout events. The onmousemove client handler alternately puts two values in an input box. the effect is that the text moves back and forth as the user moves the mouse. The onmouseout client handler clears that value.
<xp:button value="Test" id="button1">
	<xp:eventHandler event="onmousemove" submit="false">
		<xp:this.script>
			<![CDATA[var e = window.document.getElementById("#{id:inputText1}");
			if (e.value == "Mouse moving") {
				e.value = "    Mouse moving"
			} else {
				e.value = "Mouse moving"
			}]]>
		</xp:this.script>
	</xp:eventHandler>
	<xp:eventHandler event="onmouseout" submit="false">
		<xp:this.script>
			<![CDATA[var e = window.document.getElementById("#{id:inputText1}");
			e.value = null]]>
		</xp:this.script>
	</xp:eventHandler>
</xp:button>