menu + frames problems - SOLVED (kinda)

Having problems with DHTML Menu? There is usually somebody here who knows the answer.
Post Reply
ca_grover
Beginner
Beginner
Posts: 6
Joined: Tue Jul 22, 2003 10:48 pm

menu + frames problems - SOLVED (kinda)

Post by ca_grover »

Hi all.

I've been asked to get a menu working with cross-frame capabilities, and milonic was purchased for this. So, I have set up the files with partial success. But there are 2 issues remaining that are stumping me for now.

er, ignore that, one of the problems just went away - must have been caching the old files. (second sub menu was throwing a "g has no properties" error)

So, the remaining problem then is that the sub menus don't show the first time the main menu item is moused over. leaving that item, then coming back to it shows the sub menu properly. I don't know where to look to fix this one. Any tips?

I realize code would help, but don't know which code would be pertinent here.

Thanks for any tips.
Last edited by ca_grover on Sun Apr 30, 2006 6:49 am, edited 1 time in total.
ca_grover
Beginner
Beginner
Posts: 6
Joined: Tue Jul 22, 2003 10:48 pm

Post by ca_grover »

Forgot to mention, I'm testing this on Firefox, on a Linux system (Gentoo with KDE 3.5). Of course, the site will need to work cross browser, but I want to get it working before worrying about details like that... :)
User avatar
Ruth
 Team
 Team
Posts: 8763
Joined: Thu May 15, 2003 5:02 am
Location: Yucaipa, CA
Contact:

Post by Ruth »

Hi,

If there is any way you can put the pages up someplace for us to test it would be best. If you can't then what we need is the code to create the pages and frameset, plus the menu_data files - think they are called header and body and side if you're using the layout that is in the demo.

We also need to know your menu version number, there were some issues that have been fixed in different upgrades so you need to be using the newest version.

If you haven't seen the demo for frames go to:

http://support.milonic.com/demos/frames/index.htm

I have noticed the problem you mention, not showing the submenu on first mouseOver. I am reporting it. I believe the menu version on Milonic is the new pre-release version, so whatever is going on will probably fixed pretty quick once I report it.

Ruth
ca_grover
Beginner
Beginner
Posts: 6
Joined: Tue Jul 22, 2003 10:48 pm

Post by ca_grover »

Thanks Ruth.

Yep, I did see that link, and used it extensively to get to where I'm at.

I've put the files up on my own server for now. You can see it at http://grover.open2space.com/test/index.html

The libraries being used were purchased/downloaded today. So, I *think* I have the latest versions. I'm using the mm_navframe.js file from the sample download on the demo page you mentioned.

The odd thing is that the sample code from the demo site works as expected, but my code doesn't. So, it would appear I've messed something up (or just missed something).

(btw, I've noticed you are VERY busy on this list.. :) just wanted to say it's appreciated.)
User avatar
Ruth
 Team
 Team
Posts: 8763
Joined: Thu May 15, 2003 5:02 am
Location: Yucaipa, CA
Contact:

Post by Ruth »

Hi,

Your site is working just as the Demo site is working. I've reported the problem. Both sites won't open the submenu until you mouseOn, mouseOff and then mouseOn again. I'm sure Andy will get it fixed pretty quick. He's good about that.

You can go here viewtopic.php?t=3108

and look for the watch this topic line, bottom or top I believe. Click it and you should get an email notice when John posts that the new version is ready.

As a final note, I suggest that you put a call for the mm_navFrame.js file in the header also, even though you are not calling submenus. It won't interfere with anything and if you ever put a submenu into the header menu you won't run into problems because you forgot that file call.

Thanks for the thanks :) I enjoy helping on Milonic, I really like this menu and I have the time to play with it and try new things :)

Ruth
ca_grover
Beginner
Beginner
Posts: 6
Joined: Tue Jul 22, 2003 10:48 pm

Post by ca_grover »

Thanks Ruth.

I'm just curious - is there anyway I can trigger the roll over event on the pertinent menu items from code (on page load)? I'm thinking this would act as that first mouse over, and then the menu should work properly.
User avatar
Ruth
 Team
 Team
Posts: 8763
Joined: Thu May 15, 2003 5:02 am
Location: Yucaipa, CA
Contact:

Post by Ruth »

Hi,

Well, I can only think that maybe some javascript function could do that but I do not know js nor do I know programming to be able to go into the menu programming and see what the function would have to address in the program to do that. Sorry :(

I have reported the problem to Andy and I'm sure that it will be fixed soon. Andy is marvelous at getting any little glitches fixed quickly.

Ruth
Last edited by Ruth on Sun Apr 30, 2006 2:49 pm, edited 1 time in total.
ca_grover
Beginner
Beginner
Posts: 6
Joined: Tue Jul 22, 2003 10:48 pm

Post by ca_grover »

I thought I'd take a crack at this, and see if I can at least hack a solution until the official fix is done. (I'm pretty experienced with Javascript, and can actually understand the code in the menu.js file if I were to take the time to expand it to be more readable... :) )

It occured to me that we already have to set an 'onfunction' value to set a call to openSubmen(). And it seemed that the first attempt to show the menu would fail but subsequent attempts succeeded. So, I wondered if calling openSubmenu() twice would do the trick. To do this, I created a wrapper function, and then set the 'onfunction' value to the name of my wrapper function. I'll explain a bit below:

Code: Select all

function showevent() {
	openSubmenu();
	openSubmenu();
}
This did the trick. Some basic testing shows it to work fine in Firefox, and IE. But Konqueror (on KDE 3.5), has problems drawing the submenu properly about 90% of the time - but only on the first display of it.

I put that function in my menu_data.js file, below the menu specific code.

Hopfully this helps anyone else who might run into this. But I do hope the core problem is found so a hack like this isn't needed.

(before this I had last used a Milonic menu in 2003 - I was impressed with it then, and am quite happy to see it's been kept current and grown some features. I'm confident this bug will get resolved, and the menu will continue to improve.)
User avatar
Ruth
 Team
 Team
Posts: 8763
Joined: Thu May 15, 2003 5:02 am
Location: Yucaipa, CA
Contact:

Post by Ruth »

Hi,

Thanks for the solution, that's terrific.

One thing, for those who don't know a darn thing about js ---me :) --- are you putting the function just after the top section with the menuOpenDelay and before the style?

Edit: forgot to add, there is another area you might want to check every once in a while, it has the menu version information, like what is fixed in a certain version, what is added and so on.


http://milonic.com/menuvinfo.php

Ruth
ca_grover
Beginner
Beginner
Posts: 6
Joined: Tue Jul 22, 2003 10:48 pm

Post by ca_grover »

I just tacked it onto the end of the menu_data.js file. like so:

Code: Select all

with(milonic=new menuname("Main Menu")){
alwaysvisible=1;
left=0;
orientation="vertical";
style=menuStyle;
top=0;
aI("image=menu1.gif;overimage=menu1_over.gif;url=http://www.google.ca;target=content;");
aI("image=menu2.gif;overimage=menu2_over.gif;showmenu=sub1;target=content;onfunction=showevent();offfunction=closeSubmenu();");
aI("image=menu3.gif;overimage=menu3_over.gif;url=http://www.google.ca;target=content;");
aI("image=menu4.gif;overimage=menu4_over.gif;url=http://www.google.ca;target=content;");
aI("image=menu5.gif;overimage=menu5_over.gif;showmenu=sub2;target=content;onfunction=showevent();offfunction=closeSubmenu();");
aI("image=menu6.gif;overimage=menu6_over.gif;url=http://www.google.ca;target=content;");
}

drawMenus();

function showevent() {
	openSubmenu();	
	openSubmenu();
}
The nature of Javascript allows for great flexibility on where the functions are declared. As long as the function definition exists on the page somewhere, you can call it from almost anywhere. Of course there's some exceptions:

- You cannot call the function when the page is loading, unless the function has already been included.
- A function should not be declared INSIDE a set of braces { } - such as the "with(menuStyle=new mm_style()){" block.
- The function is very specific to the page it is declared on. You have to worry about window communication tricks to call that function from another frame/window.

That's just a short overview. The best advice I have though is to try it. JavaScript is a very forgiving language. It is rare that you crash the computer when you make a mistake. So, if one want's to know if something will work, just try it. If it doesn't work, reverse the changes.

Glad I could help. (And get this taken care of for my client.)
Post Reply