/    Sign up×
Community /Pin to ProfileBookmark

Menu Coding Problems …

Hi guys,
I’ve got a problem with a drop-down menu I found on the net. Here is the code :

<script language=”JavaScript”>
function doit(header){
var head=header;
flag=”0″;
if (head.className==”ferme”) { flag=”1″ }
document.getElementById(“1,2”).className = “ferme”;
if (flag==”1″) { head.className=”ouvre” }

}
</script>

and :

<div style=”cursor:hand” onClick=”doit(document.getElementById(‘1′,’2’))”>menu 1</div>
<span class=”ferme” id=”1″>submenu 1</span>

with only 1 submenu it’s working but when i’m adding 1 it’s not working … can anyone help me plz?

Thx,

~Francky683~

to post a comment
JavaScript

12 Comments(s)

Copy linkTweet thisAlerts:
@VladdyJul 06.2004 — Menu is a (nested) list of links - that should be your starting point:

www.vladdy.net/Demos/CSSNav.html
Copy linkTweet thisAlerts:
@Francky683authorJul 07.2004 — maybe but sadly im not speaking that language : ...

Thanks anyways ?

~Francky683~
Copy linkTweet thisAlerts:
@VladdyJul 07.2004 — Guess its time to learn HTML and CSS - the two languages you need. ?
Copy linkTweet thisAlerts:
@Francky683authorJul 07.2004 — look guys i already can code in PHP and HTML but i'm starting un Javascript ... is it so hard to help me when you guys can?

If you don't want to help me say it and i'm gonna find help somewhere else ...

~Francky683~
Copy linkTweet thisAlerts:
@VladdyJul 07.2004 — Learn CSS [b]before[/b] getting into scripting.

I gave you an example of menu that does not require scripting in real browsers (and a few lines in old crappy ones).
Copy linkTweet thisAlerts:
@Francky683authorJul 07.2004 — look i forgot to post but the only CSS needed in this script are those ones :

.ferme { display: none }

.ouvre { display: block }

...

~Francky683~
Copy linkTweet thisAlerts:
@VladdyJul 07.2004 — You are missing the point: [b]Not only you do not need scripting to create a menu, making it depend on scripting is a BAD IDEA[/b]
Copy linkTweet thisAlerts:
@Francky683authorJul 07.2004 — lol maybe ... but the effect of this script looks nice and i want it ... so if you don't want to help me someone else will maybe help me ...

Thanks for your great help,

~Francky683~
Copy linkTweet thisAlerts:
@fredmvJul 07.2004 — You already got all the help you need. Check out the previously provided link and study the code behind it.
Copy linkTweet thisAlerts:
@Francky683authorJul 07.2004 — look i'm not speaking that damn language
Copy linkTweet thisAlerts:
@ToamJul 07.2004 — goto altavista.com and translate the page.

if you don't know what language it is just try a few different languages until it makes sense (or as much sense as the dodgey translations ever make).
Copy linkTweet thisAlerts:
@VladdyJul 07.2004 — www.lipsum.com:rolleyes:
×

Success!

Help @Francky683 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.16,
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: @nearjob,
tipped: article
amount: 1000 SATS,

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

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