Responsive Burger Menu Not Closing

Hello

I hope you don’t mind me asking for help again. It should be simple to those more experienced - I’ll be going back to my boring non-coding day job soon!

I have inserted a burger menu for phones, however it stays open when someone clicks a link, despite my below jquery. What am I doing wrong?!

<script>
	
$(document).ready(function() {
    $('.toggle-nav').click(function(e) {
        $(this).toggleClass('active');
        $('.menu ul').slideToggle('active');
 
        e.preventDefault();
    });
});
</script>
<script>
	
$(document).ready(function() {
    $('.switch').click(function {
        $('.menu ul').slideToggle('slow');
}
});
</script>

http://www.iwillbeawebdeveloper.co.uk/Dark%20Matter/index.html#

Thanks again
James

You have a typo. It should look like this:

<script>
$(document).ready(function() {
    $('.switch').click(function() {
        $('.menu ul').slideToggle('slow');
  });
});
</script>

Sounds about right!! Thanks.

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.