Back To Start Of Archive
Taken From The Forum: Help & Support for DHTML Menu Version 5+
Forum Topic: Click to view post
Last Updated: Saturday July 14 2012 - 06:07:07
Mac IE positioning problem fix/work-around
Poster: iwbyte
Dated: Thursday October 14 2004 - 6:39:30 BST
I just finished spending a couple hours finding a work-around to the whole "IE for Mac doesn't play nice" issue. Its a kludge, and for some may not be a solution, but it works for me.
We're using the popup() method to call the menus, since we want our site navigatable w/out javascript and for other reasons.
Of course, we're using a table for layout, which means that Mac IE messes up the positioning of the popup menus.
so the solution for me was to have two menu_data.js files - one for IE for Mac, and one for everyone else.
Here's what I did - in the header of my pages, I use the following in place of the standard script call:
Code:
<SCRIPT language="JavaScript" src="/milonic_src.js" type="text/javascript"></SCRIPT>
<script language="JavaScript">
if(ns4)_d.write("<scr"+"ipt language=JavaScript src=/mmenuns4.js><\/scr"+"ipt>");
else _d.write("<scr"+"ipt language=JavaScript src=/mmenudom.js><\/scr"+"ipt>");
if ((navigator.platform == "MacPPC") && (navigator.appName =="Microsoft Internet Explorer")) _d.write("<scr"+"ipt language=JavaScript src=/menu_data_ie.js><\/scr"+"ipt>");
else _d.write("<scr"+"ipt language=JavaScript src=/menu_data.js><\/scr"+"ipt>");
</script>
<script language="JavaScript">
if(ns4)_d.write("<scr"+"ipt language=JavaScript src=/mmenuns4.js><\/scr"+"ipt>");
else _d.write("<scr"+"ipt language=JavaScript src=/mmenudom.js><\/scr"+"ipt>");
if ((navigator.platform == "MacPPC") && (navigator.appName =="Microsoft Internet Explorer")) _d.write("<scr"+"ipt language=JavaScript src=/menu_data_ie.js><\/scr"+"ipt>");
else _d.write("<scr"+"ipt language=JavaScript src=/menu_data.js><\/scr"+"ipt>");
</script>
Therefore IE for mac uses the /menu_data_ie.js data file, which has top and left ofsets that are correct for the distance from the table.
So yes, i'm doing double work, and if I ever change the menu I have to do it twice, but at least it works, and I don't have to redo my whole table/menu!
Of course, this still doesn't fix the 'pop-up-once-only-until-i-refresh' issue I get with IE for Mac - anyone got a solution for that one?
e.g. http://www.betham.org/
Hope this helps someone else!
Poster: kevin3442
Dated: Friday October 15 2004 - 0:10:41 BST
Thanks for the info.
I was wondering if you had tried using popup() to open a menu at an image's position, rather than at a position specified in the menu definition? In other words:
Code:
popup("menuName", "imageName", topOffset, leftOffset);
To do this:
(1) Set the name= and id= attributes in the <img> tag; use the same value for both. The name/id you use becomes the second parameter passed to popup().
(2) Remove the top= and left= properties from the menu definition.
The third and fourth parameters passed to popup() are top and left offsets... i.e., the number of pixels to move the menu from the position of the image that's used as the anchor. If you try it, you may find that the top and left offsets still need some adjusting between Mac/IE and other browsers. I don't have a Mac, so I can't test. If the offsets do vary between Mac/IE and other browsers, then you could make the adjustments with conditionals and variables in one menu_data.js file, if you didn't want to maintain two separate files.
Also, there are a couple of built-in global variables that you might find useful in your browser tests: mac and mac45. if (mac) returns true for any version of IE on a Mac. if (mac45) returns true for IE 4.5 on a Mac. If nothing else, these might be useful in your sniffing for IE on a Mac in your .html file. These globals are available after milonic_src.js is loaded. There's a list of other globals on this page.
iwbyte wrote:
Of course, this still doesn't fix the 'pop-up-once-only-until-i-refresh' issue I get with IE for Mac - anyone got a solution for that one?
I don't know if I missed that one in another post. If you can point to the particular post, or describe it again here, I might have an idea or two.
Cheers,
Kevin
Poster: iwbyte
Dated: Friday October 15 2004 - 2:35:35 BST
Kevin,
Thanks - I guess I need to do some RTFM and check out those suggestions.
As far as the other issue, here's that post:
http://www.milonic.com/forum/viewtopic. ... ght=#24369