Skip to content

Commit 242c2f9

Browse files
authored
Capture the right click event
1 parent 1a07fa7 commit 242c2f9

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

README.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -345,3 +345,17 @@ for(let [key,value] of Object.entries(obj)){
345345
// order is not guaranteed
346346
347347
```
348+
# Capture the right click event
349+
350+
```javascript
351+
window.oncontextmenu = () => {
352+
console.log('right click');
353+
return false // cancel default menu
354+
}
355+
//or
356+
357+
window.addEventListener('contextmenu', ()=>{
358+
console.log('right click');
359+
return false // cancel default menu
360+
},false)
361+
```

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy