JSFiddle - React, Tailwind, and code Playground
HTML
<div id="one" class="box"></div>
<div id="two" class="box"></div>
<div id="three" class="box"></div>
<div id="four" class="box"></div>
<div id="hover">HOVER ME</div>
CSS
.box{height:100px; width:100px; display:inline-block; opacity:0;}
#one{background:red;}
#two{background:blue;}
#three{background:green;}
#four{background:yellow;}
JavaScript
var boxes = ["#one","#two","#three","#four"];
boxhover = function(a){
$("#hover").hover(
function(){
$(a).stop(true).delay(250).animate({opacity:1});
},
function(){
$(a).stop(true).delay(250).animate({opacity:0});
}
)
}
for(var i=0; i<boxes.length; i++)
{
boxhover(boxes[i])
}