View Full Version : help with DHTML menu
Can somebody please tell me what I have done wrong with the DHTML menu that I have been working on.
It is attached below.
Any help is greatly appreciated.
Just to note, its my first attempt at a menu. I have always used the ones from sites like JavaScriptkit and the like before now.
Thanks.
i took a look at you're source,
and it seems to be a mess.
try to make it easier ro read, use new lines and tabs.
Then you can find errors much faster and other people will understand you're code better.
you're also using html comments in javascript. ( <!--Comment--> ),
Javascript has it own comments,
// This is a one line comment
/*
This is a
comment with
more lines
*/
So first replace the comments and then look if it has any error left.
Thanks for the info.
I didnt think that the comments would make a difference. I will change it and then post the revised copy here.
Thanks again.
Okay. I have made the alterations Rene suggested, but the menu still dows not work.
I have done my best to clean up the code so it is more readable.
I have a feeling that the names of the meus are the problem. But I may be wrong however.
Thanks for the help so far.
MikeParent
01-03-2003, 09:57 AM
The code is still a mess and riddled with errors
1) Your browser detection will never find a browser called "Internat Explorer" ;-)
2) As a good coding practice you should specify a language="javascript" in your script tag.
3) You are missing a bunch of "end of line" semicolons.
4) Preferably 1 statement per line - otherwise it is very hard to read/debug... such as:
5) meu_list[3] ...? and...
6) menu_collection = newAray()
7) You seem to have a missing or misplaced closing brace in the hide() fn
8) document.omousemove = findMouse; is not passing the required parameter as defined by your function "function findMouse(e)" (also, should that be onmousemove?)
9) In function mouseOutOfMenu(thisitem) you have return =1 instead of return 1
Having said all that, as far as why it doesnt work... I am not really sure - one thing I do know is that it is not hapy about doing the the showSubMenu() function on the mouseover for some reason... not sure why though
Man, and I thought it was only one problem :(.
Oh well. Back to the drawing board I suppose.
Yours, Beev
MikeParent
01-03-2003, 10:21 AM
Yeah its a weird one, in the past when I had errors like this I just moved the functions to a script block after the </html> but even that did not work...
I will also try to find some time to look at it on the weekend...
i've allready worked on it, and it isn't easy.
i had to rewrite most of the show functio to get it work :(
I guess its best to start again from scratch :(
Oh well.
maybe you should read some javascript tuts.
or look at examples.
here are a few good site :
Scott Andrew (http://www.scottandrew.com)
Brainjar (http://www.brainjar.com)
and Javascript kit
they have good tuts and examples.
"maybe you should reads some javascript tuts",
I think I should :D
I already saw Brainjar and the others. I find them too Cut & Paste like.
I would prefer a tutorial that will explain the code step by step instead of just saying "now copy and paste the follwing", then you have about 60 lines of code to insert.
Then it just tells you which bits to edit. I dont really learn anything that way.
Thanks again.
if you realy want it explained you should realy go to Scott Andrew (http://www.scottandrew.com)
he explains everything very well
vBulletin® v3.8.6, Copyright ©2000-2012, Jelsoft Enterprises Ltd.