JSFiddle - React, Tailwind, and code Playground
by pangorgo
HTML
<div id="container"></div>
CSS
#container {\
position: relative;
width: 200px;
height: 200px
}
#container>svg {
position: absolute !important;
top: 0;
left: 0;
}
JavaScript
var topLayer = Raphael('container', 200, 200);
var bottomLayer = Raphael('container', 200, 200);
topLayer.circle(100, 100, 50)
.attr({
fill: 'red',
stroke: false
})
.mousedown(function(){alert('Top layer')});
bottomLayer.circle(120, 120, 50)
.attr({
fill: 'pink',
stroke: false
})
.mousedown(function(){alert('Bottom layer')});;