JSFiddle - React, Tailwind, and code Playground
long right click event
HTML
Long right click this:
<img src="https://jsfiddle.net/img/[email protected]"/>
JavaScript
(function() {
var longpress = 2000;
var start;
$( "img" ).on( 'mousedown', function( e ) {
start = new Date().getTime();
} );
$( "img" ).on( 'mouseleave', function( e ) {
start = 0;
} );
$( "img" ).on( 'contextmenu', function( e ) {
if ( new Date().getTime() >= ( start + longpress ) ) {
return false;
}
} );
}());