Interesting IE problem

Having problems with DHTML Menu? There is usually somebody here who knows the answer.
Post Reply
hbrand
Advanced
Advanced
Posts: 10
Joined: Tue Oct 14, 2003 10:01 pm

Interesting IE problem

Post by hbrand »

I've got the menu working real well and doing most of what I want at:

http://www.roberthildebrand.com/websites/see/index.html

except that I wanted to pop it in a table cell so that it will float centered with the table. Seems easy...I did it just fine and it works perfectly in Scape 7.x for MacOS X and Safari 1.0, but the submenus are really offset down and to the right in IE 5.2.2 for MacOS X. You can see it here:

http://www.roberthildebrand.com/website ... xtest.html

Be aware that indextest uses jscripts in subdirectory [menus2]

Likely it's something really dumb that I overlooked, but it could be a bug!!

Best,
Robert

http://www.roberthildebrand.com
finest in landscape photography
User avatar
Maz
Milonic God
Milonic God
Posts: 1717
Joined: Fri Jun 06, 2003 11:39 pm
Location: San Francisco
Contact:

Post by Maz »

I checked, by going to another page, it sits correct, but just that one the submenus are offset, looking at the source, there doesn't appear to be any difference between the pages, are there?

I suggest moving the script tags from header to just below body.

On your test page, remove the div, take the source code out of table and put it under body, then only place menu-data in the table without div.

Let us know if it makes any difference.

Thank you
maz
User avatar
John
 Team
 Team
Posts: 5967
Joined: Sun May 19, 2002 8:23 pm
Location: Phoenix, AZ
Contact:

Post by John »

Right on, Maz :!:
John
hbrand
Advanced
Advanced
Posts: 10
Joined: Tue Oct 14, 2003 10:01 pm

fixed it!

Post by hbrand »

Actually, the fix was a matter of putting the initial menu itself in the table cell and moving the jscript calls back into the header. Now it acts like a grown up!! I won't bother to upload the corrected test version, but I've included a snippet below if others need to see it. The corrected version will be up at http://www.roberthildebrand.com/websites/see/ later today.

Best,
Robert

http://www.roberthildebrand.com
the best in landscape photography

<head>
<style type="text/css" media="screen">
<!--
@import "main.css";
-->
</style>
<link rel="stylesheet" href="scape4.css" type="text/css">
<SCRIPT language=JavaScript src="menu2/milonic_src.js" type=text/javascript></SCRIPT>
<script language=JavaScript>
if(ns4)_d.write("<scr"+"ipt language=JavaScript src=menu2/mmenuns4.js><\/scr"+"ipt>");
else _d.write("<scr"+"ipt language=JavaScript src=menu2/mmenudom.js><\/scr"+"ipt>");
</script>
<SCRIPT language=JavaScript src="menu2/menu_data.js" type=text/javascript></SCRIPT>
</head>

<body bgcolor="#000000">
<div align="center">
<table width="780" cellspacing="0" cellpadding="0" class="whitetable"><tr><td colspan="3">
<img src="images/page1a.gif" border="0" usemap="#head"><img src="images/page1b.jpg"><br>
<script>with(milonic=new menuname("Main Menu")){
style=menuStyle;
alwaysvisible=1;
orientation="horizontal";
position="relative"
aI("image=images/page2a_new.gif;");
aI("image=overview_off.gif;overimage=overview_on.gif;showmenu=overview;");
aI("image=subjects_off.gif;overimage=subjects_on.gif;showmenu=subjects;");
aI("image=news_off.gif;overimage=news_on.gif;showmenu=news;");
aI("image=people_off.gif;overimage=people_on.gif;showmenu=people;");
aI("image=jobs_off.gif;overimage=jobs_on.gif;showmenu=jobs;");
aI("image=apply_off.gif;overimage=apply_on.gif;url=apply.html;");
aI("image=major_off.gif;overimage=major_on.gif;url=majoring.html;");
aI("image=links_off.gif;overimage=links_on.gif;showmenu=links;");
aI("image=images/page2c_new.jpg;");
}
drawMenus();
</script><img src="images/page_3a.gif">
User avatar
John
 Team
 Team
Posts: 5967
Joined: Sun May 19, 2002 8:23 pm
Location: Phoenix, AZ
Contact:

Post by John »

Actually, what I think Maz was after, and I mis-read because it was another 19+ hour day, was the following...

1. JS calls to the menu code go as the first items after <body>...

Code: Select all

<SCRIPT language=JavaScript src="menu2/milonic_src.js" type=text/javascript></SCRIPT>	
<script language=JavaScript>
if(ns4)_d.write("<scr"+"ipt language=JavaScript src=menu2/mmenuns4.js><\/scr"+"ipt>");		
else _d.write("<scr"+"ipt language=JavaScript src=menu2/mmenudom.js><\/scr"+"ipt>"); 
</script>
<SCRIPT language=JavaScript src="menu2/menu_data.js" type=text/javascript></SCRIPT>
OR, if table-bound, move the _data.js call to the <td> by itself.

2. The "Main Menu" code remains in the _data.js file, not in the HTML.

Some of us have been finding this works better than the example.

However - point is you got it working. Welcome to the Milonic family :!:
John
hbrand
Advanced
Advanced
Posts: 10
Joined: Tue Oct 14, 2003 10:01 pm

why I did it the way I did...

Post by hbrand »

Yes, I can see those solutions, but I wanted to include two different ends to the menu. You'll notice that the entire initial menu comprises images with rollovers (if you do this you might want to preload the overimages especially if you have many or large images elsewhere on the page). The interior pages have a different right end. Of course, I could have simply had two different styles in the data file, but I decided it was even easier to just change the end images. That's why I dumped the style right into the menu spot.

You can view the finished centered and embedded menu at:

http://www.roberthildebrand.com/websites/see/



Best,
Robert
http://www.roberthildebrand.com[/code]
User avatar
Maz
Milonic God
Milonic God
Posts: 1717
Joined: Fri Jun 06, 2003 11:39 pm
Location: San Francisco
Contact:

Post by Maz »

Nice touch!

Wish I could use a cute image.
Mercury isn't so cute.

Regards
maz
User avatar
John
 Team
 Team
Posts: 5967
Joined: Sun May 19, 2002 8:23 pm
Location: Phoenix, AZ
Contact:

Post by John »

Good job, Robert!
John
User avatar
John
 Team
 Team
Posts: 5967
Joined: Sun May 19, 2002 8:23 pm
Location: Phoenix, AZ
Contact:

Post by John »

maz wrote:Wish I could use a cute image.
Mercury isn't so cute.
Yeah, but you are... :D
John
Post Reply