HTMLonmousewheel属性_


定義と使用法

onmousewheel属性は、マウスホイールが要素上でロールアップまたはロールダウンされたときに発生します。

非推奨。onmousewheel属性は非推奨です。代わりに、 onwheel属性を使用する必要があります。


に適用されます

onmousewheel属性は、イベント属性の一部であり、任意のHTML要素で使用できます。

要素 イベント
すべてのHTML要素 オンマウスホイール

Imgの例

ユーザーが<div>要素の上でマウスホイールを回したときにJavaScriptを実行します。

<div onwmousewheel="myFunction()">Roll the mouse wheel over me</div>

ブラウザのサポート

Event Attribute
onmousewheel Yes Yes Not supported Yes Yes