마우스 커서 이벤트 onmousemove onmouseover onmouseout - 마우스 커서 이동시, 마우스 커서 얻을때, 마우스 커서 잃을때
2014. 1. 29. 17:58
- <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
- <!-- 현재 작성하고 있는 파일은 UTF-8 DOS파일입니다.-->
- <html xmlns="http://www.w3.org/1999/xhtml" lang="ko">
- <head>
- <meta http-equiv="content-type" content="text/html; charset=utf-8" />
- </head>
- <body>
- <div id="ex_js_syntax">
- <script type="text/javascript" language="javascript">
- <!--
- /* Mouse Events onclick ondblclick onmousedown
- onmouseup onmousemove onmouseover onmouseout */
- function onmousemove_event(){
- /* onmousemove 이벤트 */
- alert("onmousemove 실행되였어요");
- }
- function onmouseover_event(){
- /* onmouseover 이벤트 */
- alert("onmouseover 실행되였어요");
- }
- function onmouseout_event(){
- /* onmouseout 이벤트 */
- alert("onmouseout 실행되였어요");
- }
- //-->
- </script>
- <form name="input_type" id="input_type" method="post" >
- <!-- 예제 박스에선 안됨 => form태그안에 form태그있으면 지워짐~ㅠ.ㅠ -->
- <input type="text" value="마우스 커서 이동시" onmousemove="onmousemove_event();">
- <br />
- <input type="text" value="마우스 커서 얻을때" onmouseover="onmouseover_event();">
- <br />
- <input type="text" value="마우스 커서 잃을때" onmouseout="onmouseout_event();">
- <br />
- </form>
- </div>
- </body>
- </html>
--------------------------------------------------------------------------------------------
위 소스 예제 보기
onmousemove , onmouseover , onmouseout
onmousemove - 마우스 커서 해당 태그범위에서 이동시 이벤트가 발생합니다.
onmouseover - 마우스 커서 해당 태그범위에서 올때 이벤트가 발생합니다.
onmouseout - 마우스 커서 해당 태그범위에서 벗어날때 이벤트가 발생합니다.
출처 & 인용 - http://www.w3schools.com/
'javascript > js기본문법' 카테고리의 다른 글
객체-속성과 메서드 (0) | 2014.01.29 |
---|---|
기타 이벤트(예제없음) onLoad onUnload onAbort onError onResize (0) | 2014.01.29 |
마우스 클릭 이벤트 onclick ondblclick onmousedown onmouseup - 클릭, 더블클릭, 마우스 버튼 누를때, 마우스 버튼 놓을때 (0) | 2014.01.29 |
Keyboard 이벤트 onkeydown, onkeyup, onkeypress - 키보드누를시, 키보드놓을시, 출력시 (1) | 2014.01.29 |
form이벤트 onfocus, onblur, onchange, onsubmit - 포커스얻을시, 포커스잃을시, 교체시, 폼보낼시 (1) | 2014.01.29 |