HTML

[attribute] HTML - onmousewheel 속성 - (폐기예고) 마우스휠 움직일 때 실행 (= onmousewheel속성 = 온마우스휠속성) ※ onmousewheel이벤트 = 온마우스휠이벤트 ※ onwheel 속성으로 대체됨.

목차
  1. onmousewheel 예제 - 마우스휠 움직일 때 실행
  2. onmousewheel 정의
  3. onmousewheel 구문

※ 폐기예고(Deprecated) 됨.

 

onmousewheel 예제 - 마우스휠 움직일 때 실행

 

<style>

#hz {

  border: 1px solid black;

  padding:10px;

}

</style>


<div id="hz" onmousewheel="homzzang()"><li>홈짱닷컴 Homzzang<li>홈페이지 제작관리 강의<li>그누보드 기초강의</div>


<script>

function homzzang() {

  document.getElementById("hz").style.fontSize = "25px";

}

</script>


결과보기

 

onmousewheel 정의

 

마우스휠이 위/아래로 움직일 때 실행할 코드 지정.

 


 

1. onmousewheel 속성 사용 가능 태그 종류

모든 가시 HTML 요소

 

2.

폐기예고(Deprecate) 됨. 대신, onwheel 속성 사용.

 

3.

모든 브라우저 지원.

 

 

onmousewheel 구문

 

HTML 방식

  • <element onmousewheel="myScript">

 

JS 방식 (3가지)

  • object.onmousewheel = ()=>{myScript};
  • object.onmousewheel = function(){myScript};
  • object.addEventListener("mousewheel", myScript);



[속성값]

 

myScript

마우스휠이 위/아래로 움직일 때, 실행할 JS 코드

  • 주의: 함수명 사용 시, 다른 곳은 전부 소괄호까지 사용해 함수 호출하나 핑크색 myScript 자리는 "함수명만" 사용해 함수 호출.
  • 사용 방식 통일 권장.

 

 


분류 제목
attribute HTML - oncopy 속성 - 요소의 텍스트나 이미지 태그를 복사 시 실행 (=oncopy속성 = 온카피…
attribute HTML - oncuechange 속성 - 트랙의 큐(캡션/자막) 변경 시 실행 (= oncuechange속…
attribute HTML - oncut 속성 - 요소 내용 잘라내기 시 실행 (= oncut속성 = 온컷속성) ※ oncut…
attribute HTML - ondblclick 속성 ★ - 요소 더블클릭 이벤트 시 실행 (= ondblclick속성 = …
attribute HTML - ondrag 속성 - 드래그 이벤트 시 실행할 코드 지정 (= ondrag속성 = 온드래그속성)…
attribute HTML - ondragend 속성 - 드래그 종료 시 실행 (= ondragend속성 = 온드래그엔드속성)…
attribute HTML - ondragenter 속성 - 드래그 한 요소가 드롭박스에 들어갈 때 실행 (= ondragen…
attribute HTML - ondragleave 속성 - 드래그 한 요소가 드롭박스 이탈 시 실행 (= ondragleav…
attribute HTML - ondragover 속성 - 드래그 한 요소가 드롭박스 위에 위치 시 실행 (= ondragov…
attribute HTML - ondragstart 속성 - 드래그 시작 시 실행 (= ondragstart속성 = 온드래그스…
attribute HTML - ondrop 속성 - 드래그 한 요소를 드롭 할 때 실행 (= ondrag속성 = 온드래그속성)…
attribute HTML - ondurationchange 속성 - 재생시간 데이터가 변경될 때 실행 (= onduratio…
attribute HTML - onemptied 속성 - 미디어 소스가 비어있거나 삭제된 경우에 실행 (= onemptied속…
attribute HTML - onended 속성 - 미디어 재생 끝날 때 실행 (= onended속성 = 온엔디드속성) ※ …
attribute HTML - onerror 속성 - 미디어파일 로딩 에러 시 실행 (= onerror속성 = 온에러속성) ※…
6/12
목록
 홈  PC버전 로그인 일본어
그누앞단언어
그누뒷단언어
그외코딩언어
그누보드
제작의뢰
Q&A
커뮤니티 2
웹유틸
회원센터
홈짱닷컴 PC버전 로그인