.hover-element:hover { z-index: 999; }
$('..hover-element').on('mouseenter mouseleave', function(e) { this.style.zIndex = e.type === 'mouseenter' ? 999 : 1; });