EN
이 콘텐츠는 한국어로 제공되지 않아 영어 버전으로 표시됩니다.

losecapture | onlosecapture event

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

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.

The pEvtObj parameter is required for the following interfaces:

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


<!DOCTYPE html>
<html>
<head>
  <title>Example of the onlosecapture Event on an Object</title>
  <style>
    #divOwnCapture {
      height: 275px;
      width: 400px;
      background-color: gray;
      font-family: sans-serif;
      font-size: 12pt;
    }

    #divNoCapture {
      height: 275px;
      width: 400px;
      background-color: white;
      font-family: sans-serif;
      font-size: 12pt;
    }
  </style>
</head>

<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 <strong>setCapture</strong> method. The text area will track
      the <strong>mousemove</strong> event anywhere in the document.
    </p>
    <textarea id="txtWriteLocation" cols="2"></textarea>
  </div>
</body>
</html>

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=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
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

 

 

표시:
© 2014 Microsoft. All rights reserved.