I have incorporated this code pen in my website to create a menu button for mobile view: http://codepen.io/anon/pen/LNNaYp
Unfortunately, the button sometimes breaks when clicked repeatedly, causing the 'X' state to appear even when the menu is closed.
I am seeking advice on how I can enhance my JavaScript skills as I attempted using jQuery without success.
HTML
<body>
<div class="showcase"><button type="button" role="button" aria-label="Toggle Navigation" id="buttonOne" class="lines-button x2">
<span class="lines"></span>
</button>
</div>
</body>
CSS
body {
background-color: #5DC1AF;
}
.showcase {
margin-top: 40px;
text-align: center;
}
(lines-button styling and transitions codes..)
JS
A piece of JS script that allows the button's functionality with open/close behavior.