--- title: GlobalEventHandlers.onpointerout slug: Web/API/GlobalEventHandlers/onpointerout translation_of: Web/API/GlobalEventHandlers/onpointerout ---
一个{{domxref("GlobalEventHandlers","global event handler")}} 用于处理 {{event("pointerout")}} 事件。
var outHandler = targetElement.onpointerout;
outHandler
targetElement
的指针输出事件处理程序。这个例子展示了两种方式来使用onpointerout设置元素的pointerout事件处理程序。
<html> <script> function outHandler(ev) { // Process the pointerout event } function init() { var el=document.getElementById("target1"); el.onpointerout = outHandler; } </script> <body onload="init();"> <div id="target1"> Touch me ... </div> <div id="target2" onpointerout="outHandler(event)"> Touch me ... </div> </body> </html>
Specification | Status | Comment |
---|---|---|
{{SpecName('Pointer Events 2','#widl-GlobalEventHandlers-onpointerout', 'onpointerout')}} | {{Spec2('Pointer Events 2')}} | Non-stable version |
{{SpecName('Pointer Events', '#widl-GlobalEventHandlers-onpointerout', 'onpointerout')}} | {{Spec2('Pointer Events')}} | Initial definition |
{{Compat("api.GlobalEventHandlers.onpointerout")}}