EN
Dieser Inhalt ist in Ihrer Sprache leider nicht verfügbar. Im Folgenden finden Sie die englische Version.

releaseCapture method

Removes mouse capture from the object in the current document.

Syntax

object.releaseCapture()

Parameters

This method has no parameters.

Return value

Type: HRESULT

If this method succeeds, it returns S_OK. Otherwise, it returns an HRESULT error code.

Standards information

There are no standards that apply here.

Remarks

For releaseCapture to have an effect, you must set mouse capture through the setCapture method.

You can invoke the releaseCapture method on the document object. The releaseCapture method makes it unnecessary to determine which element has capture to programmatically release it. Other actions that release document capture include displaying a modal dialog box and switching focus to another application or browser window.

Examples

This example invokes the releaseCapture method on the document object.


<BODY onload="oOwnCapture.setCapture();" 
    onclick="document.releaseCapture();">
<DIV ID=oOwnCapture
    onmousemove="oWriteLocation.value = 
        event.clientX + event.clientY";
    onlosecapture="console.log(event.srcElement.id + 
        ' has lost mouse capture.')">
<TEXTAREA ID=oWriteLocation COLS=2></TEXTAREA>
</DIV>
<HR>
<DIV ID=oNoCapture>
<P>Click the document to invoke the releaseCapture method.</P>
</DIV>
</BODY>

See also

a
address
area
b
blockQuote
body
br
button
caption
cite
code
custom
dd
div
dl
document
dt
em
embed
fieldSet
form
hn
hr
i
img
input type=submit
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=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
onlosecapture
setCapture
msSetPointerCapture
msReleasePointerCapture
Conceptual
About Mouse Capture

 

 

Build date: 11/14/2012

Anzeigen:
© 2014 Microsoft