이 번역은 완료되지 않았습니다. 이 문서를 번역해 주세요.
윈도우에서 마우스 오른쪽 클릭시 발생하는 이벤트 이벤트 핸들러 속성 입니다. 기본동작을 막지 않는 한 (아래의 예제를 참조하세요), 브라우저의 컨텍스트 메뉴가 활성화됩니다. (그러나 IE8는 이것과 관련된 버그가 있어 contextmenu 가 정의 되어있다고 할지라도 활성화 되지 않습니다). 이 이벤트는 비활성화되지 않은(non-disabled) 오른쪽 클릭 이벤트와 함께 발생하며 "contextmenu" 속성 을 가진 엘리먼트에는 달리지 않는다는 것을 유의하세요.
Syntax
window.oncontextmenu = funcRef; //funcRef refers to the function to be called
Example
페이지상에서 오른쪽 클릭을 막는 예제들 입니다:
document.oncontextmenu = function () { // Use document as opposed to window for IE8 compatibility return false; }; window.addEventListener('contextmenu', function (e) { // Not compatible with IE < 9 e.preventDefault(); }, false);
Specifications
Specification | Status | Comment |
---|---|---|
HTML Living Standard The definition of 'oncontextmenu' in that specification. |
Living Standard |
Browser Compatibility
We're converting our compatibility data into a machine-readable JSON format.
This compatibility table still uses the old format,
because we haven't yet converted the data it contains.
Find out how you can help!
Feature | Chrome | Edge | Firefox (Gecko) | Internet Explorer | Opera | Safari (WebKit) |
---|---|---|---|---|---|---|
Basic support | (Yes) | (Yes) | ? | ? | ? | ? |
Feature | Android | Android Webview | Chrome for Android | Edge | Firefox Mobile (Gecko) | Firefox OS | IE Mobile | Opera Mobile | Safari Mobile |
---|---|---|---|---|---|---|---|---|---|
Basic support | No support | No support | No support | ? | ? | ? | ? | ? | ? |