I'm having trouble implementing a dynamic menu on my webpage using jQuery
. I've tried writing the code myself but it doesn't seem to be working as expected.
The structure involves three classes: .dead
, which sets display: none;
in CSS, .header-main
, representing one div, and .header-main-menu
, which should appear when a button is clicked.
$(document).ready(function () {
var trigger = $('a.header-main'),
var mainstuff = $('.header-main'),
var menustuff = $('.header-main-menu');
function buttonSwitch() {
mainstuff.addClass('.dead');
menustuff.removeClass('.dead');
trigger.click(function () {
buttonSwitch();
});
}
});
Despite my efforts, the button doesn't trigger any action. As I am new to jQuery, I would greatly appreciate any assistance you can offer. Thank you for your help! :)