查看“︁JavaScript/wheel”︁的源代码
来自康健生活
←
JavaScript/wheel
因为以下原因,您没有权限编辑该页面:
您请求的操作仅限属于该用户组的用户执行:
用户
您可以查看和复制此页面的源代码。
== 引言 == 滚动事件 === 组成 === 鼠标的滚轮事件主要有两种: * mousewheel (firefox 不支持,非标准弃用) * DOMMouseScroll (只有 firefox 支持,非标准弃用) == mousewheel == 触摸板的双指操作行为触发 mousewheel 事件。 === 双指 === {| class="wikitable" |+ 双指操作行为 |- | 上滑动 || 下滑动 || 左滑动 || 右滑动 || 放大 || 缩小 |} ==== 快速滑动 ==== {| class="wikitable" |- ! !! 方向 !! 值域 |- | deltaX || 示例 || 示例 |- | deltaY || 示例 || 示例 |- | deltaZ || 示例 || 示例 |} ==== 缓慢滑动 ==== {| class="wikitable" |- ! !! 方向 !! 值域 |- | deltaX || 示例 || [-3, 3] |- | deltaY || 示例 || [-3, 3] |- | deltaZ || 示例 || 示例 |} ==== 放大/缩小 ==== 这里对比一个<code>放大/缩小</code>和<code>向上/向下/向左/向右</code>的动作。 {{hcdiff|head=|output=<syntaxhighlight lang="bash" highhight="11"> isTrusted: true altKey: false bubbles: true button: 0 buttons: 0 cancelBubble: false cancelable: true clientX: 491 clientY: 339 composed: true ctrlKey: true currentTarget: null defaultPrevented: true deltaMode: 0 deltaX: -0 deltaY: 5.265862464904785 deltaZ: 0 detail: 0 eventPhase: 0 fromElement: null layerX: 491 layerY: 339 metaKey: false movementX: 0 movementY: 0 offsetX: 492 offsetY: 340 pageX: 491 pageY: 339 path: (9) [main#boardDocumentDrag.board-document-drag, div.board-document, div.container, div, div#app, body#syno-nsc-ext-gen3.ext-webkit.ext-chrome.ext-mac, html.ext-strict, document, Window] relatedTarget: null returnValue: false screenX: 491 screenY: 418 shiftKey: false sourceCapabilities: null srcElement: main#boardDocumentDrag.board-document-drag target: main#boardDocumentDrag.board-document-drag timeStamp: 64205.89999999106 toElement: main#boardDocumentDrag.board-document-drag type: "wheel" view: Window {window: Window, self: Window, document: document, name: '', location: Location, …} wheelDelta: -240 wheelDeltaX: 0 wheelDeltaY: -240 which: 0 x: 491 y: 339 [[Prototype]]: WheelEvent</syntaxhighlight>|output2=<syntaxhighlight lang="bash" highhight="11"> isTrusted: true altKey: false bubbles: true button: 0 buttons: 0 cancelBubble: false cancelable: true clientX: 648 clientY: 331 composed: true ctrlKey: false currentTarget: null defaultPrevented: true deltaMode: 0 deltaX: -6 deltaY: -0 deltaZ: 0 detail: 0 eventPhase: 0 fromElement: null layerX: 648 layerY: 331 metaKey: false movementX: 0 movementY: 0 offsetX: 648 offsetY: 331 pageX: 648 pageY: 331 path: (9) [main#boardDocumentDrag.board-document-drag, div.board-document, div.container, div, div#app, body#syno-nsc-ext-gen3.ext-webkit.ext-chrome.ext-mac, html.ext-strict, document, Window] relatedTarget: null returnValue: false screenX: 648 screenY: 410 shiftKey: false sourceCapabilities: null srcElement: main#boardDocumentDrag.board-document-drag target: main#boardDocumentDrag.board-document-drag timeStamp: 87451.29999999702 toElement: main#boardDocumentDrag.board-document-drag type: "wheel" view: Window {window: Window, self: Window, document: document, name: '', location: Location, …} wheelDelta: 18 wheelDeltaX: 18 wheelDeltaY: 0 which: 0 x: 648 y: 331 [[Prototype]]: WheelEvent </syntaxhighlight>}} == 属性 == * deltaX * deltaY * wheelDelta * deltaMode * detail == 触摸板 == 触摸板逻辑包括<code>双指在触摸板上持续滑动</code>、<code>双指滑动后松开任其自由滑动一段距离</code>两种状态。 === 问题 === * 使用触摸板触发事件,由于系统的平滑处理,会触发多次事件。 * IE 下无法使用触摸板触发该事件。{{Qm|有待验证}} == error == == 参考 == * https://developer.mozilla.org/zh-CN/docs/Web/API/Element/wheel_event
此页面嵌入的页面:
模板:Hcdiff
(
查看源代码
)
模板:Hcdiff/style.css
(
查看源代码
)
模板:Qm
(
查看源代码
)
返回
JavaScript/wheel
。
导航菜单
康健生活
搜索
user-page
通知
user-interface-preferences
个人工具
登录
五一
多读书,多运动,多到远处走走,再看看不一样的世界。