There are two diva - the parent (relative) and child (absolute).
The child has a height and width - 0 (invisible), a shadow and is positioned in the center of the parent.
By hover on the parent via JQ, the child is stretched to the width and height of the parent. All is good, but the shadow goes under the boundaries of the parent unit.
Broke the whole head, I can not think of how to show a shadow outside the parent.
Html:
<div class="main-social-3"> <div class="main-social-3-1"> <table> <tr> <td> <img class="img-responsive" src="/img/all-partners-1.jpg" alt="" /> </td> </tr> </table> </div> <p>Maxi card</p> <span>Партнер</span> <div class="main-social-3-hover"></div> </div> CSS:
.main-social-3 { width: 25%; float: left; text-align: center; padding-top: 25px; padding-bottom: 45px; position: relative; border: 1px solid blue; } .main-social-3-hover { -webkit-box-shadow: 0px 0px 29px 1px rgba(173,171,173,1); -moz-box-shadow: 0px 0px 29px 1px rgba(173,171,173,1); box-shadow: 0px 0px 29px 1px rgba(173,171,173,1); position: absolute; width: 0; height: 0; top: 50%; left: 50%; } Jquery:
$(".main-social-3").hover(function () { $(this).find(".main-social-3-hover").animate({ height: '100%', width: '100%', left: '0', top: '0' }) }, function () { $(this).find(".main-social-3-hover").animate({ height: '0', width: '0', left: '50%', top: '50%' }) }) I see the only way - to make the child on top of the parent, despite the fact that he is inside.
How to implement this?
