JSFiddle - React, Tailwind, and code Playground
HTML
<div id="main" style="position:relative;z-index:1;">
<div id="lefttop">left top</div>
<div id="righttop">right top</div>
<p style="clear:both;"></p>
<div id="leftbottom">left bottom</div>
<div id="rightbottom">right bottom</div>
</div>
CSS
#main div{position:relative; border: 1px solid #000000; padding:10px;margin:8px; float:left; width:150px; height:150px; z-index: 2;}
JavaScript
$(function(){
$("#main > div").mouseover(function() {
$('#main > div').css('z-index' , '2');
if(this.id == "lefttop"){
aoptions = {width: "340px", height: "340px", backgroundColor: "#CCCCCC", left: '0', top: '0'}
}else if(this.id == "righttop"){
aoptions = {width: "340px", height: "340px", backgroundColor: "#CCCCCC", left: '-=190', top: '0'}
}else if(this.id == "leftbottom"){
aoptions = {width: "340px", height: "340px", backgroundColor: "#CCCCCC", left: '0', top: '-=190'}
}else if(this.id == "rightbottom"){
aoptions = {width: "340px", height: "340px", backgroundColor: "#CCCCCC", left: '-=190', top: '-=190'}
}
$(this).css('z-index' , '99').animate(aoptions, 800);
}).mouseout(function(){
if(this.id == "lefttop"){
aoptions = {width: "150px", height: "150px", backgroundColor: "#FFFFFF", left: '0', top: '0'}
}else if(this.id == "righttop"){
aoptions = {width: "150px", height: "150px", backgroundColor: "#FFFFFF", left: '+=190'}
}else if(this.id == "leftbottom"){
aoptions = {width: "150px", height: "150px", backgroundColor: "#FFFFFF", left: '0', top: '+=190'}
}else if(this.id == "rightbottom"){
aoptions = {width: "150px", height: "150px", backgroundColor: "#FFFFFF", left: '+=190', top: '+=190'}
}
$(this).animate(aoptions, 800);
});
});