onmousewheel 属性は、要素の上でマウスホイールをロールアップまたはダウンしたときに発火します。
非推奨。 onmousewheel 属性は、推奨されていませんので、 代わりに onwheel 属性を使用してください。
onmousewheel 属性は イベント属性 の一つで、全ての HTML 要素で使用することができます。
要素 | イベント |
---|---|
全ての HTML 要素 | onmousewheel |
ユーザが <div> 要素の上でマウスホイールをロールしたときに JavaScript を実行します:
<div onwmouseheel="myFunction()">Roll the mouse wheel over me</div>
Try it Yourself ❯
イベント属性 | |||||
---|---|---|---|---|---|
onmousewheel | Yes | Yes | サポートなし | Yes | Yes |