JSFiddle - React, Tailwind, and code Playground
HTML
<table>
<tr>
<td>
<div id="Serration" class="ModList" style="width:100px;">ffffffffffffffffffffff</div>
</td>
<td>
<div id="Serration2" class="ModList" style="width:100px;">ffffffffffffffffffffff</div>
</td>
</tr>
<tr>
<td>
<div id="Redirection" class="ModList" style="width:100px;">ffffffffffffffffffffff</div>
</td>
<td>
<div id="Redirection2" class="ModList" style="width:100px;">ffffffffffffffffffffff</div>
</td>
</tr>
<tr>
<td>
<div id="Hello" class="ModList" style="width:100px;">ffffffffffffffffffffff</div>
</td>
<td>
<div id="Hello2" class="ModList" style="width:100px;">ffffffffffffffffffffff</div>
</td>
</tr>
</table>
CSS
.ModList {
height: 40px;
width: 40px;
background: red;
overflow: hidden;
-moz-transition:width 0.3s;
-webkit-transition:width 0.3s; /* Safari */
-o-transition:width 0.3s;
}
JavaScript
/* Brizingr5: MODLIST */
var ModList_x = false;
var ModList_y;
var ModList_obj = new Object();
$('.ModList').mouseenter(function() {
ModList_y = $(this).attr('id');
if(ModList_obj[ModList_y] == undefined) {
ModList_obj[ModList_y] = false;
}
/* $('#'+ModList_y).css('width', '950px'); */
$('#'+ModList_y+'2').css('width', '80px');
$('#'+ModList_y+'2').css('background', 'blue');
});
$('.ModList').mouseleave(function() {
ModList_y = $(this).attr('id');
if(ModList_obj[ModList_y] == false){
/* $('#'+ModList_y).css('width', '550px'); */
$('#'+ModList_y+'2').css('width', '40px');
$('#'+ModList_y+'2').css('background', 'purple');
}
});
$('.ModList').mousedown(function() {
y = $(this).attr('id');
$('#'+ModList_y+'2').css('background', 'green');
if(ModList_obj[ModList_y] == false) {
ModList_obj[ModList_y] = true;
return;
}
if(ModList_obj[ModList_y] == true) {
ModList_obj[ModList_y] = false;
return;
}
});