Hi guys!

I am working on a website and i try to make the side menu (sidr) close when i access a menu item. Usually after i click/tap on one, the menu still stays and i need to close it using the menu button again.

I succeeded to make it work on desktops, but i dont know how to make it on mobile.

Could anyone help me?

Here is the code i used to make it work on desktop:
Code:
<script src="js/jquery.sidr.js"></script>
<script>
$(document).ready(function() {
$('#simple-menu').sidr();
});
</script>

<script src="js/jquery.touchswipe.js"></script>
 
<script>
$(document).click(function () {
$.sidr('close');
});

$(document).keyup(function ( e ) {
var key = e.keyCode || e.which;
if ( key === 27 ) {
$.sidr('close');
}
});

</script>