The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.
Fires when the object starts to move.
Syntax
| HTML Attribute | <element onmovestart = "handler(event)"> |
|---|---|
| Event Property | object.onmovestart = handler; |
| attachEvent Method | object.attachEvent("onmovestart", handler) |
| addEventListener Method | object.addEventListener("movestart", handler, useCapture) |
Event information
| Synchronous | No |
|---|---|
| Bubbles | No |
| Cancelable | No |
Event handler parameters
- pEvtObj [in]
-
Type: IHTMLEventObj
Standards information
There are no standards that apply here.
Remarks
The onmovestart event fires only when an editable element starts to move.
This event can only be bound to absolutely positioned elements.
Calls the associated event handler if there is one.
To invoke this event, do one of the following:
- Start to move the editable object.
The pEvtObj parameter is required for the following interfaces:
- HTMLAnchorEvents2
- HTMLAreaEvents2
- HTMLButtonElementEvents2
- HTMLControlElementEvents2
- HTMLDocumentEvents2
- HTMLElementEvents2
- HTMLFormElementEvents2
- HTMLImgEvents2
- HTMLFrameSiteEvents2
- HTMLInputFileElementEvents2
- HTMLInputImageEvents2
- HTMLInputTextElementEvents2
- HTMLLabelEvents2
- HTMLLinkElementEvents2
- HTMLMapEvents2
- HTMLMarqueeElementEvents2
- HTMLObjectElementEvents2
- HTMLOptionButtonElementEvents2
- HTMLScriptEvents2
- HTMLSelectElementEvents2
- HTMLStyleElementEvents2
- HTMLTableEvents2
- HTMLTextContainerEvents2
- HTMLWindowEvents2
Examples
The following example shows how to use the onmovestart event with a movable DIV and have the background color and inner text change when the DIV starts to move.
Code example: http://samples.msdn.microsoft.com/workshop/samples/author/dhtml/refs/onmovestartendEx1.htm
<!DOCTYPE html>
<html>
<head>
<title>Editing events sample page</title>
<script>
// Turn on 2D positioning
document.execCommand("2D-position",false,true);
// Fires when the onmovestart event is fired
function fnHandleMoveStart() {
var oDiv = event.srcElement
oDiv.style.backgroundColor = "green";
oDiv.innerText = "I Started Moving";
}
// Function called when the onmoveend event is fired
function fnHandleMoveEnd() {
var oDiv = event.srcElement
oDiv.style.backgroundColor = "red";
oDiv.innerText = "I Stopped";
}
</script>
</head>
<body onmovestart="fnHandleMoveStart();" onmoveend="fnHandleMoveEnd();">
<div contenteditable="true">
<div style="width:300px;height:100px; color:white; background-color:red;
position:absolute;">
My 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=file
- input type=hidden
- input type=image
- input type=password
- input type=radio
- input type=reset
- input type=submit
- input type=text
- 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
Send comments about this topic to Microsoft
Build date: 12/5/2012