/    Sign up×
Community /Pin to ProfileBookmark

DOM help, need to modify a menu script

Hi. I’m trying to modify a script I found for a dynamic menu. [url]http://www.blazenewmedia.com/articles/creating-a-dynamic-navigation-menu[/url]
To do what the last poster in that thread asked about. I think what I need is to add a function that detects the state of sibling nodes when a child node is clicked and, if a sibling is ‘open’, closes that menu before opening itself. In the same way that only one of the 1st childnodes can be in an open state at a time, I want to make it so only one of the 2nd child nodes can be open. Only I can’t figure out how to do it and its driving me nuts. So I thought perhaps someone here might be willing to attempt it and, more importantly, explain what they’re doing. I’m sorry if this is the wrong place for this sort of question. Thank you for your time.

to post a comment
JavaScript

0Be the first to comment 😎

×

Success!

Help @elpengrd 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.15,
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,
)...