JSFiddle - React, Tailwind, and code Playground
by Rino Raj
HTML
<script src="https://ajax.googleapis.com/ajax/libs/jqueryui/1.11.4/jquery-ui.min.js"></script>
<link rel="stylesheet" href="https://ajax.googleapis.com/ajax/libs/jqueryui/1.11.4/themes/smoothness/jquery-ui.css">
<div id="containment-wrapper">
<img class="box" src="http://www.techinsights.com/uploadedImages/Public_Website/Content_-_Primary/Teardowncom/Sample_Reports/sample-icon.png" >
</div>
CSS
.box{
width: 150px;
height: 150px;
box-shadow: inset 0 0 20px
}
#containment-wrapper{
width:100%;
height:100%;
background-color:black;
opacity:0.7;
}
JavaScript
$(document).ready(function(){
$("img").mouseup(function(){
$("#containment-wrapper").css("background-color", "black");
});
$("img").mousedown(function(){
$("#containment-wrapper").css("background-color", "white");
});
});