/    Sign up×
Community /Pin to ProfileBookmark

navigation script uncompatable

the following script is for a dropdown navigation tree, is it possible to make it compatable with all browsers?

[code] menu.js
<!–
var ns6 = document.getElementById && !document.all ? 1 : 0
var folder = ”

function expand(curobj) {
folder = ns6 ? curobj.nextSibling.nextSibling.style : document.all[curobj.sourceIndex + 1].style

if (folder.display == “none”)
folder.display = “”
else
folder.display = “none”

return 0
}

function doNothing() {
return
}
//–>
[/code]

[code] html file
<a href=”javascript:doNothing()” onclick=”javascript:expand(this)” class=”header”>Example Header1</a>
<div style=”display: none;”>
<a href=”info.php” class=”link”>Example Link</a><br />
<a href=”info.php” class=”link”>Example Link</a><br />
<a href=”info.php” class=”link”>Example Link</a><br />
<a href=”info.php” class=”link”>Example Link</a><br />
</div>
[/code]

any help is greatly appreciated

to post a comment
JavaScript

8 Comments(s)

Copy linkTweet thisAlerts:
@khalidali63Mar 08.2003 — The code seems to work for both IE6+ and NS6+..

Khalid
Copy linkTweet thisAlerts:
@xaviorgauthorMar 08.2003 — yeah i know, but what about older versions, and Mozilla, and other browsers, like Opera and the other Linux browsers (someone else told me it should work with those also) but im not completely sure
Copy linkTweet thisAlerts:
@khalidali63Mar 08.2003 — NS6+ browsers are based on mozilla,as far as I am aware of most of the popular browsers for Unix/Linux are Mozilla based(including NS) ,Opera's newer versions do comply with DOM1 andd CSS1 specs,therefore you are ok there,the only problem will be NS browsers <5 versions.

Is that worth the effort?

Khalid
Copy linkTweet thisAlerts:
@xaviorgauthorMar 08.2003 — well, i dont think NS<5 compatibilty would hurt
Copy linkTweet thisAlerts:
@xaviorgauthorMar 08.2003 — ok, ive got this to add to it:

addition to menu.js
var ns4 = document.layers ? 1 : 0


where do i go from here?
Copy linkTweet thisAlerts:
@khalidali63Mar 08.2003 — You do not have to worry about NS <5 browsers at all.The code you already have should be sufficient...

Cheers

Khalid
Copy linkTweet thisAlerts:
@xaviorgauthorMar 08.2003 — thank you very much for you help ?

Cheers to you as well!
Copy linkTweet thisAlerts:
@xaviorgauthorMar 09.2003 — any ideas how i can make a function that will close any open folder when you open another folder?
×

Success!

Help @xaviorg 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.28,
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,
)...