HTML onmousewheel 屬性
定義和用法
當滑鼠滾輪在一個元素上上下滾動時,onmousewheel 屬性會觸發。
已棄用。 onmousewheel 屬性已棄用,您應該改用 onwheel 屬性。
適用範圍
onmousewheel 屬性是 事件屬性 的一部分,可用於任何 HTML 元素。
元素 | 事件 |
---|---|
所有 HTML 元素 | onmousewheel |
示例
圖片示例
當用戶在 <div> 元素上滾動滑鼠滾輪時,執行 JavaScript
<div onwmousewheel="myFunction()">在我的上方滾動滑鼠滾輪</div>
自己動手試一試 »
瀏覽器支援
事件屬性 | |||||
---|---|---|---|---|---|
onmousewheel | 是 | 是 | 不支援 | 是 | 是 |