Perly X Perly X - 3 months ago 8
CSS Question

Toggle all the sudden won't work, JQuery

I've helped/worked with a website project hte last month but is now stuck since the .toggle function for the menu don't work as expected.

I made a fiddle of the full menu here

jQuery(document).ready(function() {
jQuery('.menuD').click(function(e) {
jQuery(this).toggleClass('active');
jQuery('.mennu').toggleClass('active');

e.preventDefault();
});
});


(This is my first time using fiddle so I hope I've enterd everything the right way, as I understood it as I don't have to include the "head" area.)

I can't really figure why it ain't working since I did a similar solution for my own page last year that works and validates perfectly. Javascript aren't my strongest language so some help to find the problem(s) would be appriciated.

Answer

You have a typo :

jQuery('.mennu').toggleClass('active');

must be

jQuery('.menu').toggleClass('active');