I'm creating a responsive menu from scratch using html, css and jQuery. I was able to create it and it is working the opening and closing of toggle after click function on an image (the menu icon). The idea is now to make clicking on the menu icon, it changes to an 'x', ie would have to change the src, I think, indicating that there should be closed. Follow the current code:
<script>
$(document).ready(function() {
$('.icone-oppen-close').click(function() {
$('.itens-menu-mob').animate({
width: 'toggle'
}, 300);
$('.itens-menu-mob').css('display', 'block', fast);
});
});
</script>
<html>
<div class="menu-geral-mobile menu-mobile">
<div class="centralizar-menu-mob">
<div class="brand-topo-mob"><img src="img/logo-apple.png" /></div>
<div class="icone-oppen-close"><span class="glyphicon glyphicon-menu-hamburger"></span></div>
</div>
</div>
<div class="itens-menu-mob">
<ul>
<li><a href=""> Home</a></li>
<li><a href=""> Serviços</a></li>
<li><a href=""> Portifólio</a></li>
<li><a href=""> Contato</a></li>
<li><a href=""> Home</a></li>
<li><a href=""> Serviços</a></li>
<li><a href=""> Portifólio</a></li>
<li><a href=""> Contato</a></li>
</ul>
</div>
</html>
How can I do this quickly?