JSFiddle - React, Tailwind, and code Playground

by Mi_Creativity

HTML

<div id="test"></div>

CSS

#test{
  width:80vw;
  height:80vh;
  margin:0 auto;
  display:block;
  background-image: url('http://lorempixel.com/image_output/business-q-g-1416-1250-10.jpg');
  background-size:contain;
  outline:navy 2px solid;
}

JavaScript

$('#test').on('mousedown', function(e){
	if (e.button == 2) {
  	// if right-click, set cursor shape to grabbing
		$(this).css({'cursor':'move'});
  }
}).on('mouseup', function(){
	// set cursor shape to default
	$(this).css({'cursor':'default'});
}).on('contextmenu', function(){ 
	//disable context menu on right click
	return false;
});