JSFiddle - React, Tailwind, and code Playground
by shtrih
HTML
<div class="menu_image">
<a href="http://olteh.i-dl.ru/produkciya/vysokovoltnaya_apparatura_i_nku/transformatory">
<div class="img" style="background-image:url('http://olteh.i-dl.ru/photo/l/1_132_untitled.jpg')">
<div class="title">Трансформаторы...
<!--span class="close">↑</span-->
</div>
</div>
</a>
<a href="/produkciya/vysokovoltnaya_apparatura_i_nku/komplektnoe_raspredelitelnoe_ustroystvo_serii_km1">
<div class="img" style="background-image:url('http://olteh.i-dl.ru/photo/l/1_133_untitled.jpg')">
<div class="title">Комплектное распределительное устройство серии КМ1...
<!--span class="close">close</span-->
</div>
</div>
</a>
</div>
CSS
.menu_image {
margin:15px 0 35px;
}
.menu_image .title {
display: none;
position: absolute;
background: url('http://olteh.i-dl.ru/img/opacity.png');
min-height: 32px;
left: 0;
top: 0;
right: 0;
padding: 7px 20px 10px;
color: white;
text-decoration: none;
font-size: 1em;
text-align: center;
border-radius: 5px 5px 50% 50% / 5px 5px 15px 15px;
}
.menu_image a {
text-decoration: none;
}
.menu_image .img {
width: 200px;
height: 150px;
float: left;
background: white no-repeat center center;
position: relative;
margin: 0 0 40px 12px;
border-radius: 5px 5px 50% 50% / 5px 5px 15px 15px;
box-shadow: 0px 1px 3px #000;
-o-box-shadow: 0px 1px 3px #000;
-moz-box-shadow: 0px 1px 3px #000;
-webkit-box-shadow: 0px 1px 3px #000;
}
.title .close {
position: absolute;
float: right;
top: 0;
right: 0;
color: #fff;
background: #444;
border-radius: 0 5px 0 5px;
padding: 0px 6px 0 6px;
text-decoration: none;
}
JavaScript
// Меню-картинки //
$('.title').append('<span class="close">↑</span>');
$(".img").hover(
function () {
$(this).stop(true, true).find('.title').fadeIn('fast');
},
function () {
//$(this).find('.title').fadeOut('fast');
}
);
$(".close").hover(
function () {
$(this).parent('.title').fadeOut('fast');
}
);