Hey there! I took your original code and created a simple CodePen for you. The animation is now triggered by a click toggle with a CSS transition effect. When the menu icon is clicked, the navigation panel slides in from the left (absolute position left changes from -300px to 0) and vice versa:
$('.menu-icon').click(function(){
$('.navdiv').toggleClass('open');
});
.relative {
position: relative;
}
.navdiv{
bottom: 0px;
top:0px;
border-right: 50px solid #3184a1;
width: 300px;
position: absolute;
left: -300px;
background-color:#67b5d1;
box-shadow: 4px 0 5px rgba(0,0,0,0.2);
z-index: 0;
transition: .3s all ease-in-out;
color: black;
}
.navdiv.open {
left: 0px;
}
.navdiv:after
{
position: absolute;
content: ' ';
width: 0;
height: 0;
right: -70px;
top: 50%;
border-width: 15px 10px;
border-style: solid;
border-color: transparent transparent transparent #3184a1;
}
.menu-icon {
position: absolute;
top: 15px;
left: 8px;
z-index: 9999;
cursor: pointer;
}
ul {
position: absolute;
top: 50px;
left: 15px;
z-index: 9999;
color: red;
}
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
<img class="menu-icon" src="http://placehold.it/30x30">
<div class="navdiv">
<div class="relative">
<ul>
<li>There's something here</li>
<li>There's something here</li>
<li>There's something here</li>
<li>There's something here</li>
<li>There's something here</li>
<li>There's something here</li>
</ul>
</div>
</div>