
- Prototype 教程
- Prototype - 主頁
- Prototype - 簡要概述
- Prototype - 有用功能
- Prototype - 實用方法
- Prototype - 元素物件
- Prototype - 數字處理
- Prototype - 字串處理
- Prototype - 陣列處理
- Prototype - 雜湊處理
- Prototype - 基本物件
- Prototype - 模板化
- Prototype - 列舉
- Prototype - 事件處理
- Prototype - 表單管理
- Prototype - JSON 支援
- Prototype - AJAX 支援
- Prototype - 表達範圍
- Prototype - 定期執行
- Prototype 有用資源
- Prototype - 快速指南
- Prototype - 有用資源
- Prototype - 討論
Prototype - 事件 pointerY() 方法
此方法返回滑鼠事件的絕對垂直位置。
語法
Event.pointerY(event);
返回值
返回滑鼠事件的絕對垂直位置。
示例
透過在不同位置單擊來嘗試此示例。
<html> <head> <title>Prototype examples</title> <script type = "text/javascript" src = "/javascript/prototype.js"></script> <script> // Register event 'click' and associated call back. Event.observe(document, 'click', respondToClick); // Callback function to handle the event. function respondToClick(event) { var x_axis = Event.pointerY(event); alert("Vertical position : " + x_axis); } </script> </head> <body> <p id = "note">Click anywhere to see the result.</p> <p id = "para1">This is paragraph 1</p> <p id = "para2">This is paragraph 2</p> <div id = "division">This is divsion.</div> </body> </html>
輸出
prototype_event_handling.htm
廣告