- 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
广告