JSFiddle - React, Tailwind, and code Playground

JavaScript

window.onload = function() {
var paper = Raphael(0, 0, 640, 540);
    
    
    function aa(h1,h2){
        var showbox = paper.rect(h1+200,h2,100,100);
    }

for (i = 0; i < 2; i++) {
    for (j = 0; j < 2; j++) {
        (function(i, j) {
            var boxes = paper.rect(0 + (j * 100), 0 + (i * 100), 100, 100).attr({
                fill: '#303030',
                stroke: 'white'
            });
            boxes.node.onmouseover = function() {
                var h1 = boxes.getBBox().x;
                var h2 = boxes.getBBox().y;
                aa(h1,h2);
            };
            boxes.node.onmouseout = function() {
                showbox.attr({display:'none'});
            };
        })(i, j);
    }
}
}