mouseover
mouseoverイベントはマウスカーソルが要素と重なった際に発火するイベントです。
次のスクリプトではid属性「bar」の要素の内側にマウスカーソルが重なった際に、function(){…}内の処理が実行されます。
document.getElementById("bar").addEventListener("mouseover", function() {
alert("ok");
}, false);
mouseoverイベントはマウスカーソルのポイント1点のみが制御可能ですが、IE10からは複数の指による操作などが想定された、複数のポイントが制御できるpointeroverイベントが利用できます。
また、マウスカーソルが要素に乗った際ではなく要素から離れたに発生するイベントにはmouseoutイベントがあります。
登録日 : 2013年06月08日 最終更新日 : 2013年6月8日
同じカテゴリー(Event)のエントリー
- beforeunload
- unload
- pointercancel
- pointerhover
- mouseout
- pointerout
- mouseover
- pointerover
- pointerup
- pointermove
- pointerdown
- gestureend
- gesturechange
- gesturestart
- touchcancel
- devicemotion
- popState
- hashchange
- pagehide
- pageshow
- error
- orientationchange
- touchmove
- touchend
- touchstart
- MutationObserver
- DOMNodeInserted