/    Sign up×
Community /Pin to ProfileBookmark

menu tree, function open

I have a menu tree made in CSS and Java, its working great until I use anchor in my links. If I use anchor in the link, the destination page get distorted, the menu instead of staying open in the right section, it open every sections of the menu.

the part of the script that control the open is

[code]
function ED_TMopen(){
var i,x,d,hr,ha,ef,a,ag;if(document.getElementById){d=document.getElementById(‘EDTMnav’);
if(d){hr=window.location.href;ha=d.getElementsByTagName(“A”);if(ha&&ha.length){
for(i=0;i<ha.length;i++){if(ha[i].href){if(hr.indexOf(ha[i].href)>-1){
ha[i].className=”EDcurrentmark”;a=ha[i].parentNode.parentNode;while(a){
if(a.firstChild && a.firstChild.tagName==”A”){if(a.firstChild.onclick){
ag=a.firstChild.onclick.toString();if(ag&&ag.indexOf(“ED_TMenu”)>-1){
ED_TMenu(a.firstChild,1);}}}a=a.parentNode;}}}}}}}
}
[/code]

EDTMnav is the menu name

EDcurrentmark is the CSS specification where its specified that the text is bold and in blue.

If the anchor create this much problem, can we just set the java so the EDcurrentmark specifications can be applied only for the parent menu?

or specifying to let the menu closed when there is a link with an anchor?

to post a comment
JavaScript

0Be the first to comment 😎

×

Success!

Help @verros 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 6.2,
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: @meenaratha,
tipped: article
amount: 1000 SATS,

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

tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,
)...