onlosecapture event

Fires when the object loses the mouse capture.

Syntax

HTML Attribute <element onlosecapture = "handler(event)">
Event Property object.onlosecapture = handler;

Event information

SynchronousNo
BubblesNo
CancelableNo

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.

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.


<BODY onload="divOwnCapture.setCapture()"
    onclick="divOwnCapture.releaseCapture();">
<DIV ID=divOwnCapture
    onmousemove="txtWriteLocation.value=event.clientX 
		+ event.clientY";
    onlosecapture="console.log(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
area
b
bdo
blockQuote
body
br
button
caption
cite
code
custom
dd
div
dl
dt
em
embed
fieldSet
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
map
object
ol
option
p
pre
s
samp
select
small
span
strong
sub
sup
table
tBody
td
textArea
tFoot
th
tHead
tr
u
ul
var
Reference
releaseCapture
setCapture
msSetPointerCapture
msReleasePointerCapture
Conceptual
About Mouse Capture

 

 

Send comments about this topic to Microsoft

Build date: 11/14/2012

Show:
© 2014 Microsoft