/    Sign up×
Community /Pin to ProfileBookmark

Menu Problems

Hi. i’m totally new to javascript, i’m just starting it. but i’m trying to add a menu to my website. i have the ‘EZ menu’ and ‘HV Menu’, don’t know if you guys heard of it. but i need some help. i have tried pasting my code on my page, and checking it over again and again a menu just simply does not show. it is also very strange. in one of the examples that was given to me in both EZ Menu and HV Menu, the menus show up just fine. so i tried copying the same exact code and putting it into a new html document. true enough, it’s the same problem. no menu shows on the copied code. any suggestions guys.. since you are all basically javascripts pro and i’m a newbie. does it have something to do with my OS settings. i have a windows XP OS. thanks.

ryan

to post a comment
JavaScript

25 Comments(s)

Copy linkTweet thisAlerts:
@KidCreationJul 19.2004 — hi i'm no pro (i don't actyually know anything) but i think to help you the guys might need a link to the examples you mention and maybe a link to your own attempt
Copy linkTweet thisAlerts:
@KorJul 19.2004 — Thre a are a lot of , as you say "HV Menus" or "EZ Menus" , as many as javascript coders has this world... There is no unique menu, so it is difficult for us to help you if we don't see the code lines.

Anyway, your problem lays probably in absence of a handler which will fire the function for setting the objects (or probably you put the menu in head, while the author build it in body - which is the same thing).

Can we see your try? Or a link? Or an attachment something?
Copy linkTweet thisAlerts:
@ryan423authorJul 19.2004 — well maybe you can help me. this is not my own javascript, right now i'm using examples to help me know what is what. i got this from dynamic drive. so yeah. this is the code i'm inputting in my html document:

[CODE]
<!-- This is the HV Menu -->
<script type='text/javascript'>

//HV Menu- by Ger Versluis (http://www.burmees.nl/)
//Submitted to Dynamic Drive (http://www.dynamicdrive.com)
//Visit http://www.dynamicdrive.com for this script and more

function Go(){return}

</script>
<script type='text/javascript' src='exmplmenu_var.js'></script>
<script type='text/javascript' src='menu_com.js'></script>
<noscript>Your browser does not support script</noscript>
<!-- End -->
[/CODE]


And the intructions told me to put the .js files in my directory so i did that. apparently, i'm not even seeing a menu. nothing at all. would you like me to also paste the source code for the 2 javascipts if that may help? thanks.
Copy linkTweet thisAlerts:
@ryan423authorJul 19.2004 — this is the .js file that i would modify.

[upl-file uuid=f90d8e5f-4b54-4ae4-9745-519ee628d9ea size=4kB]exmplmenu.txt[/upl-file]
Copy linkTweet thisAlerts:
@ryan423authorJul 19.2004 — this is the other .js file i'm supposed to have in my dir.

[upl-file uuid=9b2f0230-9191-4da0-a23a-29a98ec5c9e4 size=23kB]menu.txt[/upl-file]
Copy linkTweet thisAlerts:
@KorJul 20.2004 — They say:

Step 1: Insert the following code into the <BODY>, right below the tag itself:

Have you put the code

<!-- This is the HV Menu -->

<script type='text/javascript'>

//HV Menu- by Ger Versluis (http://www.burmees.nl/)

//Submitted to Dynamic Drive (http://www.dynamicdrive.com)

//Visit http://www.dynamicdrive.com for this script and more

function Go(){return}

</script>

<script type='text/javascript' src='exmplmenu_var.js'></script>

<script type='text/javascript' src='menu_com.js'></script>

<noscript>Your browser does not support script</noscript>

<!-- End -->

exactly bellow the BODY tag?

like this:

[color=red]<body>[/body]

<!-- This is the HV Menu -->

<script type='text/javascript'>



//HV Menu- by Ger Versluis (http://www.burmees.nl/)

//Submitted to Dynamic Drive (http://www.dynamicdrive.com)

//Visit http://www.dynamicdrive.com for this script and more



function Go(){return}



</script>

<script type='text/javascript' src='exmplmenu_var.js'></script>

<script type='text/javascript' src='menu_com.js'></script>

<noscript>Your browser does not support script</noscript>

<!-- End -->

...

...

rest of HTML lines

...

...

[color=red]</body>[/body]
Copy linkTweet thisAlerts:
@KorJul 20.2004 — Sorry, I mean like this:

[color=red]<body>[/color]

<!-- This is the HV Menu -->

<script type='text/javascript'>

//HV Menu- by Ger Versluis (http://www.burmees.nl/)

//Submitted to Dynamic Drive (http://www.dynamicdrive.com)

//Visit http://www.dynamicdrive.com for this script and more

function Go(){return}

</script>

<script type='text/javascript' src='exmplmenu_var.js'></script>

<script type='text/javascript' src='menu_com.js'></script>

<noscript>Your browser does not support script</noscript>

<!-- End -->

...

...

rest of HTML lines

...

...

[color=red]</body>[/color]
Copy linkTweet thisAlerts:
@ryan423authorJul 20.2004 — yeah lol i did that, over and over again for like 5 times. i even removed all formatting and other tags except for the essentials. still not working. but it's so strange, on the example file it shows up just fine, but when i try to paste it into my file, nothing at all shows up. is there something i need to know about menus? i mean, why will it show on one html file and not on another if the coding is the same. thanks.

ryan
Copy linkTweet thisAlerts:
@PittimannJul 20.2004 — Hi!

Just a stupid question: do you have some other js (apart from the menu stuff) running onload of the window?

Cheers - Pit
Copy linkTweet thisAlerts:
@ryan423authorJul 20.2004 — no i don't believe i do. i have checked out the article about running two javascripts and how it may not work. i do have other window.[I]x[/I] but not an onload. i have also tried having another menu, and it works. haha. this is one freaky problem.
Copy linkTweet thisAlerts:
@PittimannJul 20.2004 — Hi!

In the js file, frames are specified for the display of the menu items and the target to open links in:

var FirstLineFrame='navig';// Frame where first level appears

var SecLineFrame='space'; // Frame where sub levels appear

var DocTargetFrame='space';// Frame where target documents appear

Do you have these frames?

Cheers - Pit
Copy linkTweet thisAlerts:
@ryan423authorJul 20.2004 — hi. i have these frames in this format in the exmplmenu.js file:

var FirstLineFrame='navig'; // Frame where first level appears

var SecLineFrame='space'; // Frame where sub levels appear

var DocTargetFrame='space'; // Frame where target documents appear

am i suppose to have them in my html code? i have linked it to that .js file so it shouldn't be a problem.

ryan
Copy linkTweet thisAlerts:
@ryan423authorJul 20.2004 — This is how an example was given to me:

[CODE]
<html>

<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<meta name="GENERATOR" content="Microsoft FrontPage 4.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<title>HV Menu example</title>
</head>

<body>
<script type='text/javascript'>

//HV Menu- by Ger Versluis (http://www.burmees.nl/)
//Submitted to Dynamic Drive (http://www.dynamicdrive.com)
//Visit http://www.dynamicdrive.com for this script and more

function Go(){return}

</script>
<script type='text/javascript' src='exmplmenu_var.js'></script>
<script type='text/javascript' src='menu_com.js'></script>

<noscript>Your browser does not support script</noscript>
</body>

</html>
[/CODE]


i copied the same exact code onto another page and saved it in my directory, even moving the .js files into the parent directory but nothing doing. by the way, my js files and images are saved in "HV Menu/" so i have linked it like that in the 'src' attribute.

ryan
Copy linkTweet thisAlerts:
@PittimannJul 20.2004 — Hi!

I checked the stuff a bit more deeply. That is, what I found out: the frames are not essential and do not cause the problem. But:

You have

var NoOffFirstLineMenus=5;// Number of first level items

and only 4 menus defined

And your menu Arrays lack a couple of arguments. They need

MenuX=new Array(Text to show, Link, background image (optional), number of sub elements, height, width)

and your stuff only has MenuX=new Array(Text to show, Link)

That cannot work, because the "program" file needs them (even left blank or set to 0, but not left out completely).

Cheers - Pit
Copy linkTweet thisAlerts:
@PittimannJul 20.2004 — Hi!

Example:

Menu1=new Array("Main Page","Index.html","",0,30,120);

Menu2=new Array("My Testimony","My Testimony.html","",0,30,170);

Menu3=new Array("Hobbies and Interests","Hobbiest and Interests.html","",0,30,250);

Menu4=new Array("God's Expectation of Us","God's Expectation of Us.html","",0,30,250);

And please don't forget to change the first line to:

var NoOffFirstLineMenus=4;// Number of first level items

Cheers - Pit
Copy linkTweet thisAlerts:
@ryan423authorJul 20.2004 — Hi Pittiman,

hehe. i think i might have guessed that too, would be the problem. my values would probably have to be incorrect. anyway, this is what my menu looks without the hyperlinks in the exmplmenu_var.js:

[CODE]
var NoOffFirstLineMenus=5; // Number of first level items
var LowBgColor='#00BFFF'; // Background color when mouse is not over
var LowSubBgColor='white'; // Background color when mouse is not over on subs
var HighBgColor='#00BFFF'; // Background color when mouse is over
var HighSubBgColor='black'; // Background color when mouse is over on subs
var FontLowColor='black'; // Font color when mouse is not over
var FontSubLowColor='black'; // Font color subs when mouse is not over
var FontHighColor='black'; // Font color when mouse is over
var FontSubHighColor='white'; // Font color subs when mouse is over
var BorderColor='#00EE00'; // Border color
var BorderSubColor='black'; // Border color for subs
var BorderWidth=1; // Border width
var BorderBtwnElmnts=1; // Border between elements 1 or 0
var FontFamily="arial,comic sans ms,technical" // Font family menu items
var FontSize=12; // Font size menu items
var FontBold=1; // Bold menu items 1 or 0
var FontItalic=0; // Italic menu items 1 or 0
var MenuTextCentered='center'; // Item text position 'left', 'center' or 'right'
var MenuCentered='left'; // Menu horizontal position 'left', 'center' or 'right'
var MenuVerticalCentered='top'; // Menu vertical position 'top', 'middle','bottom' or static
var ChildOverlap=.2; // horizontal overlap child/ parent
var ChildVerticalOverlap=.2; // vertical overlap child/ parent
var StartTop=240; // Menu offset x coordinate
var StartLeft=1; // Menu offset y coordinate
var VerCorrect=0; // Multiple frames y correction
var HorCorrect=0; // Multiple frames x correction
var LeftPaddng=3; // Left padding
var TopPaddng=2; // Top padding
var FirstLineHorizontal=1; // SET TO 1 FOR HORIZONTAL MENU, 0 FOR VERTICAL
var MenuFramesVertical=1; // Frames in cols or rows 1 or 0
var DissapearDelay=1000; // delay before menu folds in
var TakeOverBgColor=1; // Menu frame takes over background color subitem frame
var FirstLineFrame='navig'; // Frame where first level appears
var SecLineFrame='space'; // Frame where sub levels appear
var DocTargetFrame='space'; // Frame where target documents appear
var TargetLoc=''; // span id for relative positioning
var HideTop=0; // Hide first level when loading new document 1 or 0
var MenuWrap=1; // enables/ disables menu wrap 1 or 0
var RightToLeft=0; // enables/ disables right to left unfold 1 or 0
var UnfoldsOnClick=0; // Level 1 unfolds onclick/ onmouseover
var WebMasterCheck=0; // menu tree checking on or off 1 or 0
var ShowArrow=1; // Uses arrow gifs when 1
var KeepHilite=1; // Keep selected path highligthed
var Arrws=['tri.gif',5,10,'tridown.gif',10,5,'trileft.gif',5,10]; // Arrow source, width and height
[/CODE]


i think i may need to modify the changes you specified. thanks.

ryan
Copy linkTweet thisAlerts:
@PittimannJul 20.2004 — Hi!

You're welcome!

Have you seen may example when submitting your latest post?

Cheers - Pit
Copy linkTweet thisAlerts:
@ryan423authorJul 20.2004 — hi pittiman,

yes i have seen your example. i have executed the changes you specified and it worked. yay. after 2 days it worked. hehe. thanks man. i am new to javascripting and i should have spotted that, however i don't think the author told me it was necessary or maybe i just didn't read what he had to say. anyway, thanks, next time i will look more deeply before putting you through all this work and trouble.

on a sidenote, can i have this menu like a floating type. i don't know what you call it. like when you scroll down your page, you menu also scrolls down.

ryan
Copy linkTweet thisAlerts:
@PittimannJul 20.2004 — Hi!

That menu was originally designed to work in frames (to remain static, if the main frame is scrolled). It is not worth the effort trying to make it float in a non-frame environment.

There are menus on the www which do what you like and I can very well imagine, you might find one at Dynamic Drive, from where you got your current stuff.

Good luck!

Pit
Copy linkTweet thisAlerts:
@PittimannJul 20.2004 — Hi!

I just thought about your wish making the menu floatable and found it not to be much effort to make it work for IE and Mozilla (Mozilla will only deal with it, if the scrollbars are moved, not "onmousewheel").

Just a few steps. In the main js file (menu_com.js) go close to the end to the function CreateMenuStructure(MName,NumberOf).

There, find this part:

if(DomYes){

var MmbrCntnr=Location.document.createElement("div");

below that insert the following new line:

MmbrCntnr.id='Menu'+i;

In your HTML document, modify your body tag:

<body onscroll="staticM()">

and add a new script tag BELOW those for the menu:

<script language="JavaScript" type="text/javascript">

<!--

function staticM(){

if(DomYes){

var main=document.getElementById('Menu'+(NoOffFirstLineMenus+1));

main.style.top=document.body.scrollTop+StartTop;

}

}

//-->

</script>

This will keep the menu at the vertical position, you defined in the js file with the menu items (var StartTop=xxx); as stated above, this works on moving scrollbars in IE and Mozilla and onscroll with a wheel mouse in IE.

Cheers - Pit
Copy linkTweet thisAlerts:
@ryan423authorJul 20.2004 — hi pittiman,

sorry i got disconnected from the net a while. i'll try what you say on how to make the menu dynamic, but i think i would go for a menu that's meant to be dynamic. because i uploaded my site to a free site, it has adds at the top, and the menuheight and menuwidth will get distorted on my webserver and on my computer. so yeah thanks anwyays man.

ryan
Copy linkTweet thisAlerts:
@PittimannJul 20.2004 — Hi!

I'm glad if I could help a bit. Good luck again!

Cheers - Pit
Copy linkTweet thisAlerts:
@ryan423authorJul 20.2004 — well hey, since you seem to be a big time pro in javascript? , do you have any personal menus? like menus that are cross browser compatible, i mean i don't want something too flashy, just something that gets the job done. thanks.

ryan
Copy linkTweet thisAlerts:
@PittimannJul 20.2004 — Hi!

Sorry - I do not use js menus myself at all; I am using stuff which also works if js is disabled.

If you find any menu at least compatible with IE and Mozilla as well as other dom browsers which you really like, just use it and provide a list of links for users with js disabled or different browsers. You could hide that link list with the help of js, if a js enabled browser, the menu is compatible with is detected.

Regards - Pit
Copy linkTweet thisAlerts:
@ryan423authorJul 20.2004 — oh ok. i guess you use something more advanced. thanks.

ryan
×

Success!

Help @ryan423 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.17,
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,
)...