detect mouse click javascript
el.addEventListener('contextmenu', function(ev) {
ev.preventDefault();
alert('success!');
return false;
}, false);document.body.onclick = function (e) {
var isRightMB;
e = e || window.event;
if ("which" in e) // Gecko (Firefox), WebKit (Safari/Chrome) & Opera
isRightMB = e.which == 3;
else if ("button" in e) // IE, Opera
isRightMB = e.button == 2;
alert("Right mouse button " + (isRightMB ? "" : " was not") + "clicked!");
} /* npm i tappify */
import Tappify from "tappify";
/* Only works in react.js */
function myComponent() {
return <>
<Tappify.Finger>
Client is using finger *tap tap*
</Tappify.Finger>
<Tappify.Cursor>
Client is using mouse cursor *click click*
</Tappify.Cursor>
</>
}
//more info: https://github.com/asplunds/tappify
Also in PHP:
- date php function
- exception handling in php with example
- enable php error output
- $_SERVER php where link came from
- base64_decode() in php
- cache clear laravel command
- find a word in srting php
- check string contain symbol in php
- db seed
- create array and remove duplicates php
- array reverse order php
- How to Log Query in Laravel
- 500 server error in laravel
- Composer detected issues in your platform: Your Composer dependencies require the following PHP extensions to be installed: fileinfo
- eloquent seeds down
- Composer detected issues in your platform: laravel
- check value present in string php
- filteredduplicata php
- connect an if statement to an input php
- catch error php
- check if string not contains php
- check datatype php
- ALTER table migrations
- Allowed memory size of 134217728 bytes exhausted (tried to allocate 157 bytes) in C:\wamp64\scripts\refresh.php on line 2263