Little bug with menu and IE : still having the bug...

Having problems with DHTML Menu? There is usually somebody here who knows the answer.
Post Reply
maitredede
Advanced
Advanced
Posts: 16
Joined: Wed May 18, 2005 3:26 pm

Little bug with menu and IE : still having the bug...

Post by maitredede »

Hi

I'm continuing this post : http://milonic.com/forum/viewtopic.php?t=5968

I have the latest version of the menu

The bug is when I click forward on IE toolbar, and then backward, the menu is on the page, but stills inactive... This problems has appeared on three differents computers. I think it may come from the script I have on my pages, but I don't know why this happens

Link : http://metm.no-ip.org
User avatar
Ruth
 Team
 Team
Posts: 8763
Joined: Thu May 15, 2003 5:02 am
Location: Yucaipa, CA
Contact:

Post by Ruth »

Hi,

1. I can't find the iframe function on the page that is supposed to be used with Milonic. You need that function there before the iframe

Code: Select all

<script> 
function openIFrame(iFrameId,winURL) 
{ 
ifId=gmobj(iFrameId) 
ifId.src=winURL 
} 

</script> 
Maybe it's there and I'm just not seeing it.

2. You have the menu in a table, but the problem is you are supposed to call the files, the milonic_src.js mmenudom.js and mmenuns4.js the first thing right after the body tag, I think you are also supposed to call the file that has the menu styles and submenus at that point also.

3. You have that table in a div and you are not supposed to put the menu in a div. Most people use the center tags to center the table, or align=center in the table tag.

Ruth
maitredede
Advanced
Advanced
Posts: 16
Joined: Wed May 18, 2005 3:26 pm

Post by maitredede »

1. The function is in the file '/script/gal_scrip.js' called in <head>

2. I generate the menus with php, from your sample files. So I will rewrite some code to call the files at the right place. But why should I put my menu definition (styles, submenus) just after the body tag ? Is it so different ? I'll try. But what is the correct order ?

Code: Select all

<body>
menu scripts
menus style
submenu
<table>
...
<td>
menu1
drawmenus()
...
<td>
menu2
drawmenus()
3. ok.
maitredede
Advanced
Advanced
Posts: 16
Joined: Wed May 18, 2005 3:26 pm

Post by maitredede »

I've rewrited my code to meet the 'first thing right after the body tag' condition. Still not working... :cry:
User avatar
Ruth
 Team
 Team
Posts: 8763
Joined: Thu May 15, 2003 5:02 am
Location: Yucaipa, CA
Contact:

Post by Ruth »

Hello,
maitredede wrote:I generate the menus with php, from your sample files. So I will rewrite some code to call the files at the right place. But why should I put my menu definition (styles, submenus) just after the body tag ? Is it so different ?
Yes, it is different. I am not a code person, however the explanation provided when placing the menus in a table is that the menu files must be the first thing before any other html objects are rendered.

The Milonic site uses php, I don't know much about it, but they rename their menu_data.js file to menu_data.php something about it being parsed by the php or something. So, I'd think you could put all your style and subemnus back into the menu_data.js file and rename it menu_data.php and just call it right where the other menu program files are, right after the body tag.

As to the problem that was the main issue. I finally noticed something [sorry, it takes me awhile, I'm not a programmer or code person to know immediately what might cause a problem] Anyway, in your main menus, the ones in the tables you have

Code: Select all

position="static";
you need

Code: Select all

position="relative";
Once I did that, when I moused over items the colors changed immediately showing the on colors and the submenu opened.

Ruth
maitredede
Advanced
Advanced
Posts: 16
Joined: Wed May 18, 2005 3:26 pm

Post by maitredede »

Sorry for replying so late, i've tested your solution just now.

It seems that there is no more this problem. I've put the menu into "relative"...

Thanks.
bpolackoff
Beginner
Beginner
Posts: 4
Joined: Mon Jan 07, 2008 1:47 am

Re: Little bug with menu and IE : still having the bug...

Post by bpolackoff »

I have run into the problem myself with the menu becoming inactive when you use the Position='static' and I have also found that when changed to position='relative' the menu behaves as expected.

But here I my current problem. When I switch the menu back to position='relative' then resize the window, the menu stays in it's original location (it does not move with the rest of the site). It stays in the location on the screen the menu was first loaded.

Any ideas?
User avatar
Ruth
 Team
 Team
Posts: 8763
Joined: Thu May 15, 2003 5:02 am
Location: Yucaipa, CA
Contact:

Re: Little bug with menu and IE : still having the bug...

Post by Ruth »

Hi,

We would need to see the page to see what's happening. If you have it positioned relatively in a table or div then it should move with the container

Ruth
bpolackoff
Beginner
Beginner
Posts: 4
Joined: Mon Jan 07, 2008 1:47 am

Re: Little bug with menu and IE : still having the bug...

Post by bpolackoff »

Here is the example. Thanks for the quick reply

http://sb.centuron.net/
User avatar
Ruth
 Team
 Team
Posts: 8763
Joined: Thu May 15, 2003 5:02 am
Location: Yucaipa, CA
Contact:

Re: Little bug with menu and IE : still having the bug...

Post by Ruth »

Hi,

OK, there are a few areas about which I'll post with a solution for each thing. Sorry it is so long. I tend to try and give extra - complete answers :)

1. The menu is not put in the table correctly. There are two ways you can do it. The new method uses a buildAfterLoad=true; at the top of the data file, in the same area as the subOffsets listing. But, there are problems with this in some browsers or site setups. So, I am posting the old method here. You can see examples of the two methods here, Method 1 is the new one, and Method 2 the old. You dont' have to use the names given for the files, of course.

http://support.milonic.com/beginners/ta ... /index.htm

Open your menu data file and cut out the main menu. Paste that main menu in a separate file and add a drawMenus(); at the end of it, then save it as main_data.js or main_embed.js or whatever you want to call it. Now save your menu_data.js file without the main menu in it, but with the drawMenus(); at the end just like it is now. The only thing you remove is the main menu. You now have two files. Call the menu_data.js file up with the milonic_src.js and the mmenudom.js files, the first thing after the body tag, and call the main data file where you are now calling the menu_data.

If you must call the js files in the HEAD section of the page, then you will probably have to use the new method, though many use the old one and put the calls in the head. However, it is stated they must be called first thing after the body tag. If you use the new method, you would then add the buildAfterLoad=true; at the top of the data file, and you would call all the milonic files in the table cell

Code: Select all

<TD>
           <SCRIPT src="milonic_src.js" type=text/javascript></SCRIPT>

<SCRIPT src="mmenudom.js" type=text/javascript></SCRIPT>
 <SCRIPT src="menu_data.js" type=text/javascript></SCRIPT>
          </TD>
You can see examples of the two methods, Method 1 being the new one, and Method 2 the old. You dont' have to use the names given for the files, of course.

http://support.milonic.com/beginners/ta ... /index.htm


2. This is not an error, but since you cannot control how table cells shift as you resize a window with the mouse, it would be better to remove the left and right images from the cells on either side of the menu and put them in the menu itself. The main menu would then be

Code: Select all

with(milonic=new menuname("Main Menu")){
alwaysvisible=1;
position="relative";
margin=2;
orientation="horizontal";
style=Big;
aI("image=menu_r1_c1.jpg;itemwidth=9;type=header;");
aI("text=Home;url=http://sb.centuron.net");
aI("showmenu=About;text=About;");
aI("showmenu=Search;text=Search;");
aI("showmenu=Buyers;text=Buyers;");
aI("showmenu=Sellers;text=Sellers;");
aI("showmenu=Resources;text=Resources;");
aI("showmenu=Login;text=Login;");
aI("text=Contact;url=contact.cfm;");
aI("image=menu_r1_c5.jpg;itemwidth=9;type=header;");
}
Because it is set as type=header the mouse will not react if it goes over those items. Because these end items are now in the menu when the page is resized with the mouse everything moves together instead of showing that empty area during the move.

3. If you do it this way, you need to change the menubgimage="menu_r1_c3.jpg"; to bgimage="menu_r1_c3.jpg"; This will keep that square edge from appearing in the 1st and last header items. menubgimage goes into the whole menu, whereas bgimage is applied to each item. Because the 1st and last items are set as headers that bgimage will not show in them.

4. Now to the original problem. That is a result of the css margin code MARGIN: auto; The only fix I could find was to eliminate the MARGIN: auto; from the body tag and add align="center"; to the main surrounding table.

Code: Select all

<BODY>
<SCRIPT src="milonic_src.js" type=text/javascript></SCRIPT>
<SCRIPT src="mmenudom.js" type=text/javascript></SCRIPT>
 <SCRIPT src="menu_data.js" type=text/javascript></SCRIPT>
<TABLE cellSpacing=0 cellPadding=0 width=933 border=0 align="center">
Hope that helps. Sorry it was so long. By the way, I really like your site. Very, very nice!
bpolackoff
Beginner
Beginner
Posts: 4
Joined: Mon Jan 07, 2008 1:47 am

Re: Little bug with menu and IE : still having the bug...

Post by bpolackoff »

Thanks!!!!! I will try those fixes now and will let you know how everything goes! Thanks again!
User avatar
Ruth
 Team
 Team
Posts: 8763
Joined: Thu May 15, 2003 5:02 am
Location: Yucaipa, CA
Contact:

Re: Little bug with menu and IE : still having the bug...

Post by Ruth »

:oops: I forgot one thing. You also have to add top="offset=-2"; to all the submenus. For some reason with that align center and no margin in the css the submenus open farther down than they should. that -2 fixes them to be just like you have them. So, the subs would be, for example

Code: Select all

with(milonic=new menuname("About")){
top="offset=-2";
margin=2;
rawcss="text-align:left";
style=BigTransparent;
Ruth
bpolackoff
Beginner
Beginner
Posts: 4
Joined: Mon Jan 07, 2008 1:47 am

Re: Little bug with menu and IE : still having the bug...

Post by bpolackoff »

Thank you so much! I ultimatly, along with all the other changes you suggested, changed all pages to use the align=center for the surrounding table. Thank god for "global find and replace" :D

I do appreciate your very quick and very in depth response.

Thanks Again!
Brian
User avatar
Ruth
 Team
 Team
Posts: 8763
Joined: Thu May 15, 2003 5:02 am
Location: Yucaipa, CA
Contact:

Re: Little bug with menu and IE : still having the bug...

Post by Ruth »

You're welcome. Don't forget that since that is a commercial site you will need to purchase a license. They are pretty inexpensive, the license is for eternity, if you want it that long :), and it includes 1 year of email support and free upgrades. It also allows you to use any sample you want or all of them or any combination of them.

If you need any more help, just post back here.

Ruth
Post Reply