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 loses the mouse capture.
Syntax
| HTML Attribute | <element onlosecapture = "handler(event)"> |
|---|---|
| Event Property | object.onlosecapture = handler; |
| attachEvent Method | object.attachEvent("onlosecapture", handler) |
| addEventListener Method | object.addEventListener("losecapture", 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
Sends the event notification to the object that is losing the mouse capture.
To invoke this event, do one of the following:
- Set mouse capture to a different object.
- Change the active window so that the current document using mouse capture loses focus.
- Invoke the releaseCapture method on the document or 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
This example shows how to fire the onlosecapture event. When the user clicks the mouse, the releaseCapture method is invoked and subsequently fires the onlosecapture event.
Code example: http://samples.msdn.microsoft.com/workshop/samples/author/dhtml/refs/onlosecaptureEX.htm
<BODY onload="divOwnCapture.setCapture()"
onclick="divOwnCapture.releaseCapture();">
<DIV ID=divOwnCapture
onmousemove="txtWriteLocation.value=event.clientX
+ event.clientY";
onlosecapture="alert(event.srcElement.id
+ ' lost mouse capture.')">
<P>Mouse capture has been set to this gray division (DIV) at
load time using the setCapture method. The text area will track
the mousemove event anywhere in the document.<BR><BR>
<TEXTAREA ID=txtWriteLocation COLS=2></TEXTAREA>
</DIV>
<HR>
<DIV ID=divNoCapture>
<P>Click anywhere on the document to invoke the releaseCapture
method, whereby the onlosecapture event will fire.</P>
</DIV>
</BODY>
See also
- a
- address
- applet
- area
- b
- bdo
- big
- blockQuote
- body
- br
- button
- caption
- center
- cite
- code
- custom
- dd
- dfn
- dir
- div
- dl
- dt
- em
- embed
- fieldSet
- font
- form
- hn
- hr
- i
- 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
- kbd
- label
- legend
- li
- listing
- map
- marquee
- menu
- noBR
- object
- ol
- option
- p
- plainText
- pre
- s
- samp
- select
- small
- span
- strike
- strong
- sub
- sup
- table
- tBody
- td
- textArea
- tFoot
- th
- tHead
- tr
- tt
- u
- ul
- var
- xmp
- Reference
- releaseCapture
- setCapture
- msSetPointerCapture
- msReleasePointerCapture
- Conceptual
- About Mouse Capture
Send comments about this topic to Microsoft
Build date: 1/23/2013