//Toggle functionality for menu
$(function(){
var effect = 'slide';
var options = { direction: 'left'};
var duration = 500;
//Slide toggle menu
$('#m').click(function () {
$('#mOpt').toggle(effect, options, duration);
});
//Slides menu left to hide on key up esc
$(document).on('keyup',function(e) {
if (e.keyCode == 27) {
$('#mOpt').animate({display:'none'}, 0, function() {
$(this).hide(effect, options, duration);
});
}
});
//Slides menu left to hide when clicking on any <section>
$('section').click(function(){
$('#mOpt').animate({display:'none'}, 0, function() {
$(this).hide(effect, options, duration);
});
});
});