/    Sign up×
Community /Pin to ProfileBookmark

JavaScript not working on a page but work on the others

Hi , I have a site with 3 pages , 2 of them are kinda the same the problem is that I add this code to my JavaScript

[code]const closeNav = () => {
$(‘.nav-links’).removeClass(‘nav-active’);
};
const toggleAnimation = () => {
$(‘.burger’).toggleClass(‘animation’);
};
const closeOnClick = () => {
$(‘.nav-links a’).on(‘click’, () => {
closeNav();
toggleAnimation();
})
};

//Call changeLink function
closeOnClick();[/code]

and it works fine for 1 page but is not working for the other page . The code is for the nav make , it make it close when you lick on a tag. What happens on the other page is that makes the nav bar to no open at all.
Here is the site: https://hungry-pike-43b2a3.netlify.com/coder.html The coding projects is not working.
I am wondering if this ever happened to you ?

to post a comment
JavaScript

0Be the first to comment 😎

×

Success!

Help @codyhill spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.12,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...