English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية
onmousemove 속성은 현재 요소의 mousemove 이벤트의 이벤트 처리 함수를 가져오거나 설정합니다
마우스 포인터를 이미지 위로 이동할 때 JavaScript를 실행합니다:
<!DOCTYPE html> <html> <head> <title>HTML onmousemove 이벤트 속성의 사용(기본 튜토리얼 웹사이트 oldtoolbag.com)</title> </head> <body> <img onmousemove="bigImg(this)" onmouseout="normalImg(this)" border="0" src="pig.gif" alt="pig" width="32" height="32"> <p>마우스 포인터가 이미지 위로 이동할 때 bigImg() 함수가 호출됩니다. 이 기능은 이미지를 확대합니다.<br> 마우스 포인터가 이미지에서 벗어나면 normalImg() 함수가 호출됩니다. 이 기능은 이미지의 높이와 너비를 정상으로 설정합니다.</p> <script> function bigImg(x) { x.style.height = "64px"; x.style.width = "64px"; } function normalImg(x) { x.style.height = "32px"; x.style.width = "32px"; } </script> </body> </html>시험해 보기 ‹/›
IEFirefoxOperaChromeSafari
모든 주요 브라우저가 onmousemove 이벤트 속성을 지원합니다
포인터가 요소 위에서 이동할 때 onmousemove 속성이 발생합니다.
주의: onmousemove 속성은 다음 요소에서 사용할 수 없습니다: <base>, <bdo>, <br>, <head>, <html>, <iframe>, <meta>, <param>, <script>, <style>, 또는<title>.
없음.
<요소 onmousemove="script">
값 | 설명 |
---|---|
script | onmousemove 이벤트가 발생할 때 실행할 스크립트를 정의합니다. |