onlosecapture event (Internet Explorer)

Switch View :
ScriptFree
onlosecapture event

[This documentation is preliminary and is subject to change.]

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)

Standards information

There are no standards that apply here.

Event information

SynchronousNo
BubblesNo
CancelableNo

Event handler parameters

pEvtObj [in]

Type: IHTMLEventObj

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
Conceptual
About Mouse Capture

 

 

Build date: 3/14/2012