$('a').on({
mouseenter: function() {
$(this).find('.animIn')[0].beginElement();
},
mouseleave: function() {
$(this).find('.animOut')[0].beginElement();
}
})
body {
background: #000;
}
svg {
display: block;
margin: 0 auto;
position: relative;
top: -5px;
}
polyline {
stroke: #48B4D3;
stroke-width: 2;
}
a {
display: inline-block;
text-align: center;
text-decoration: none;
color: #48B4D3
}
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
<a href="#">Link A
<svg version="1.1" id="svg1" xmlns="http://www.w3.org/2000/svg" width="62px" height="12px" viewBox="0 0 62 12">
<polyline fill="none" stroke-miterlimit="10" points="61,10.5 51,10.5 41,10.5 31,10.5 21,10.5 11,10.5 1,10.5 ">
<animate class="animIn" begin="indefinite" attributeName="points" dur="200ms" fill="freeze" to="61,11 51,5 41,11 31,5 21,11 11,5 1,11" />
<animate class="animOut" begin="indefinite" attributeName="points" dur="200ms" fill="freeze" to="61,10.5 51,10.5 41,10.5 31,10.5 21,10.5 11,10.5 1,10.5" />
</polyline>
</svg>
</a>
<a href="#">Link B
<svg version="1.1" id="svg1" xmlns="http://www.w3.org/2000/svg" width="62px" height="12px" viewBox="0 0 62 12">
<polyline fill="none" stroke-miterlimit="10" points="61,10.5 51,10.5 41,10.5 31,10.5 21,10.5 11,10.5 1,10.5 ">
<animate class="animIn" begin="indefinite" attributeName="points" dur="200ms" fill="freeze" to="61,11 51,5 41,11 31,5 21,11 11,5 1,11" />
<animate class="animOut" begin="indefinite" attributeName="points" dur="200ms" fill="freeze" to="61,10.5 51,10.5 41,10.5 31,10.5 21,10.5 11,10.5 1,10.5" />
</polyline>
</svg>
</a>