I am on a Mac using Dreameaver's CS3 horizontal navigation. It looks great on a Mac but the drop downs on a PC always appear on the left side of the browser (using Explorer) and not under each menu item.

I'm sure this is a simple fix. At least I hope. Can someone give a bit of guidance on how to fix?

Any help would be appreciated.

Here is the link to review:

Best.

Dani AI

Generated

A concise troubleshooting summary and targeted fixes for a Spry/Dreamweaver horizontal menu that renders submenu panels at the far left in Internet Explorer.

When submenus jump to the page left edge only in IE, two reliable causes are (a) a JavaScript error that prevents the menu-initialization code from running, and (b) the submenu being absolutely positioned but lacking a positioned ancestor, so the browser uses the document body as the offsetParent. A nonstandard or missing DOCTYPE can also change offset/calculation behavior in IE. ’s comment about script problems points strongly at (a), and similar reports from indicate this is common with mixed or broken DW-generated scripts.

Practical sequence: 1) Open IE’s Developer Tools (F12) and fix the first script error shown — a single syntax error can stop all subsequent init code. 2) Confirm the menu library is included only once and that the menu-init call runs after the menu HTML exists (move scripts to the end of the body or run on DOMContentLoaded). 3) Run the page through the W3C validator to catch malformed markup that can break scripting/layout.

A quick CSS test that often proves the positioning problem is to force a positioning context on the menu wrapper:

/* temporary test: force submenu positioning context */
#navWrapper { position: relative; }
#navWrapper ul ul { position: absolute; left: 0; top: 100%; }

Isolate the problem with a minimal test page containing only the menu and its assets; use the developer tools to inspect the computed left/top of the submenu. Helpful references: W3C Markup Validation Service and HTMLElement.offsetParent — MDN.

Recommended Answers

All 5 Replies

There appears to be some problem with your coding, I get following error

Line:84
Char: 1
Error: Object expected

It is section of JavaScript

Thank you.

Do you know how to fix it? Or can direct me somewhere I can review myself?

Much appreciated.

You have lot of errors in your JavaScript. I'm not specialist into JS but I highlighted the one I spoted

<script src="SpryAssets/SpryMenuBar.js" type="text/javascript"></script>
<script language="JavaScript" type="text/javascript">function mmLoadMenus() {
  if (window.mm_menu_1210102112_0) return;
                              window.mm_menu_1210102112_0 = new Menu("root",174,26,"Arial, Helvetica, sans-serif",11,"#CCCC66","left","middle",2,0,1000,-5,7,true,true,true,0,false,false);
  mm_menu_1210102112_0.addMenuItem("CSG","location='csg1.html'"GOOGLE"NETDEVIL"COCA-COLA"VERICEPT"AOL/MAPQUEST"GEOTECH");
   mm_menu_1210102112_0.hideOnMouseOut=true;
   mm_menu_1210102112_0.bgColor='#000000';
   mm_menu_1210102112_0.menuBorder=1;
   mm_menu_1210102112_0.menuLiteBgColor='#000000';
   mm_menu_1210102112_0.menuBorderBgColor='#CCCC99';
    window.mm_menu_1210103723_0 = new
  mm_menu_1210103723_0.addMenuItem("IRWL"HRO"BURNS&nbsp;FIGA&nbsp;WILL"BARLETT&nbsp;BECK"LITTLER&nbsp;MENDELSON");
   mm_menu_1210103723_0.hideOnMouseOut=true;
   mm_menu_1210103723_0.bgColor='#000000';
   mm_menu_1210103723_0.menuBorder=1;
   mm_menu_1210103723_0.menuLiteBgColor='#000000';
   mm_menu_1210103723_0.menuBorderBgColor='#CCCC99';
window.mm_menu_1210104341_0 = new
  mm_menu_1210104341_0.addMenuItem("HALLIBURTON"SUNCORE&nbsp;ENERGY"); //Missing double quotes somewhere there as you have in set after energy
   mm_menu_1210104341_0.hideOnMouseOut=true;
   mm_menu_1210104341_0.bgColor='#000000';
   mm_menu_1210104341_0.menuBorder=1;
   mm_menu_1210104341_0.menuLiteBgColor='#000000';
   mm_menu_1210104341_0.menuBorderBgColor='#CCCC99';
    
  mm_menu_1210104341_0.writeMenus();
}
><!--
function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) { //v4.0
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && document.getElementById) x=document.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}
//-->
</script>
<script type="text/javascript" language="JavaScript">
<!-- Begin
function NewWindow(mypage, myname, w, h, scroll) {
var winl = (screen.width - w) / 2;
var wint = (screen.height - h) / 2;
winprops = 'height='+h+',width='+w+',top='+wint+',left='+winl+',scrollbars='+scroll+',resizable'
win = window.open(mypage, myname, winprops)
if (parseInt(navigator.appVersion) >= 4) { win.window.focus(); }
}
//  End -->
</script>
<script type="text/javascript" language="JavaScript" src="mm_menu.js"></script>
<link href="style.css" rel="stylesheet" type="text/css">
<script src="Scripts/AC_RunActiveContent.js" type="text/javascript"></script>
<link href="SpryAssets/SpryMenuBarHorizontal.css" rel="stylesheet" type="text/css">
<style type="text/css">
<!--
.style1 {
	font-size: 9pt
}
.style2 {font-size: 10px; font-style: normal; text-transform: none; color: #A69B66; font-family: Verdana, Arial, Helvetica, sans-serif;}
-->
</style>
</head>

<body bgcolor="#000000" text="#000000" onLoad="MM_preloadImages('/nav_aboutus_over.gif','/nav_corevalues_over.gif','/nav_teammembers_over.gif','/nav_spotlight_over.gif','/nav_testimonials_over.gif','/nav_contactus_over.gif')">
<script type="text/javascript" language="JavaScript1.2">mmLoadMenus();</script>

After this changes there are few things that you have to sort with embeded objects for example line 236. For more info follow errors that IE throws on you and also use Validation function in Dreamweaver File/Validate/Markup

Hope this help

Thank you for taking the time to review.

Best.

Well buddy i have same kinda problem , there must be some problem in your coding ..

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.