<!DOCTYPE html>
<html lang="ru">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<style>
.container {
font-size: 8rem;
display: table;
margin: 0 auto;
}
.container > span {
display: block;
float: left;
margin: 0 auto;
}
.container > .middle {
display: none;
}
</style>
</head>
<body>
<div class="container">
<span class="middle">3</span>
<span class="middle">2</span>
<span class="first">1</span>
<span class="middle">4</span>
<span class="middle">5</span>
</div>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.1/jquery.min.js"></script>
<script>
$(function () {
$('.middle').each(function () {
$(this).data('width', $(this).width());
$(this).css({width: 0}).hide();
});
var middle = $('.middle');
$('.container').mouseenter(function () {
middle.css({display: 'block'}).stop().animate({width: middle.data('width'), opacity: 1});
}).mouseleave(function () {
middle.stop().animate({width: 0, opacity: 0}, function () {
middle.hide();
});
});
});
</script>
</body>
</html>