When I hover over the blue table, two red buttons named del-row-td and del-column-td appear. However, they disappear when I move my mouse away from the table.
https://i.sstatic.net/WiWRU.png
I want to prevent these red buttons from disappearing when I hover over them, but still hide them if I move my mouse away from both the buttons and the blue table.
In order to achieve this, I have tried the following code:
$(document).on('mouseover','.del-column-td',function(){
$(this).removeClass("hide");
});
$(document).on('mouseleave','.del-column-td',function(){
$('.del-column-td').addClass('hide');
});
$(document).on('mouseover','.del-row-td',function(){
$(this).removeClass("hide");
});
$(document).on('mouseleave','.del-row-td',function(){
$('.del-row-td').addClass('hide');
});
You can view a working demo here. Can anyone provide suggestions on why it's not working and how to fix it?