move | onmove event

Fires when the object moves.

Syntax

HTML Attribute <element onmove = "handler(event)">
Event Property object.onmove = handler;
attachEvent Method object.attachEvent("onmove", handler)
addEventListener Method object.addEventListener("move", handler, useCapture)

 

Event information

SynchronousNo
BubblesYes
CancelableNo

 

Event handler parameters

pEvtObj [in]

Type: IHTMLEventObj

Standards information

There are no standards that apply here.

Remarks

This event can be bound to relatively positioned elements as well as absolutely positioned elements.

This event does not fire when it is bound to an object inside a container object that moves.

Calls the associated event handler if there is one.

To invoke this event, do one of the following:

  • Change the absolute position of the object.

The pEvtObj parameter is required for the following interfaces:

Examples

The following example shows how to use the onmove event and display the x and y coordinates of a DIV as it is moved.

Code example: http://samples.msdn.microsoft.com/workshop/samples/author/dhtml/refs/onmoveEx1.htm


<html>
<head>
<title>The onmove event</title>
<script>
// Turn on 2-D positioning
document.execCommand("2D-position",false,true);
function fnHandleMove() {
  oXDelta.innerText = event.srcElement.offsetLeft;
  oYDelta.innerText = event.srcElement.offsetTop; 
}
</script>
</head>
<body onmove="fnHandleMove();">
<b>Current Object:</b><br>
X delta: <span id="oXDelta">n/a</span><br>
Y delta: <span id="oYDelta">n/a</span><br>
<div contenteditable="true">
<div style="width:300px;height:100px; background-color:red; position:absolute;">
Movable DIV</div>
</div>
</body>
</html>


See also

a
abbr
acronym
address
applet
area
b
bdo
big
blockQuote
body
button
caption
center
cite
custom
dd
dfn
dir
div
dl
dt
em
embed
fieldSet
font
form
frame
frameSet
hn
hr
i
iframe
img
input type=button
input type=checkbox
input type=email
input type=file
input type=hidden
input type=image
input type=number
input type=password
input type=radio
input type=range
input type=reset
input type=search
input type=submit
input type=tel
input type=text
input type=url
ins
isIndex
kbd
label
legend
li
listing
marquee
menu
object
ol
p
plainText
pre
q
rt
ruby
s
samp
select
small
span
strike
strong
sub
sup
table
tBody
td
textArea
tFoot
th
tHead
tr
tt
u
ul
var
xmp

 

 

Show:
© 2014 Microsoft