1) Instead of fadeIn the hover element on the callback, do it immediately. This will prevent the white background from being displayed:
$('.grid-box .phase-1').fadeOut(300); $('.grid-box .phase-2').fadeIn(300);
2) The easiest way to do this is to specify the size in the thumbnail container and add overflow: hidden; to him.
3) Finally, the following code ensures that only elements contained in a hovering div are affected:
$(function(){ $('.grid-box').hover( function(){ $('.phase-1', this).fadeOut(300); $('.phase-2', this).fadeIn(300); }, function(){ $('.phase-2', this).fadeOut(300) $('.phase-1', this).fadeIn(300); } ); });
source share