JSFiddle - React, Tailwind, and code Playground
HTML
<div id="test1" style="width:150px;height:150px;position:relative;">
<img src="http://toddaustin.com/transparent.png" />
<iframe id="test2" src="http://www.w3schools.com" ></iframe>
</div>
CSS
#test1 img {
position:absolute;
top:0;
left:0;
width:304px;
height:150px
z-index:100;
}
iframe {z-index:2;}
JavaScript
$("html").on('mousemove', function(e) {
var x = e.pageX -12;
var y = e.pageY - 20;
$("#test1").css({'top': y, 'left': x});
});
$(function(){
$("#test1 img").click(function(){
$("#test2").hide();
});
});