using snap.svg

HTML

<script src="//cdn.jsdelivr.net/snap.svg/0.1.0/snap.svg-min.js"></script>
<html>
<style>

#test:hover
{
    fill: yellow;
}
</style>

<body>

    <div class="viewBox">
        <h1>SVG Testing</h1>


        <svg id="mysvg" height="900" width="400" version="1.1" xmlns="http://www.w3.org/2000/svg" style="background-color: gray;">

            <path d="M0 86.60254037844386L50 0L150 0L200 86.60254037844386L150 173.20508075688772L50 173.20508075688772Z" fill="green" id="test"></path>
        </svg>
    </div>
</body>
</html>

JavaScript

Snap("#test").animate({ transform: 't0,260s2,-2'},1500, mina.bounce)