I am using the below code for a menu to apear on a mobile css site.
At the moment it is appearing straight away when the site is loaded and I'd rather it load only on request when it is used... Any help? - I know it's a quick solution but cannot seem to work this out, i've tried other forums and searched online and yet to hear a response.
<script type="text/javascript">
jQuery(document).ready(function($){
/* prepend menu icon */
$('#nav-wrap').prepend('<div id="menu-icon"><img id="logo" src="<?php echo site_url(); ?>/wp-content/themes/blue-and-grey/images/mobileimages/hme_btn.png" /></div>');
/* toggle nav */
$("#menu-icon").on("click", function(){
$("#nav").slideToggle();
$(this).toggleClass("active");
});
});
</script>