Click to See Complete Forum and Search --> : Possibly "absolute positioning" problem in code


hitekmom
11-25-2003, 04:51 PM
Hi All, Here's the problem I'm having:

I created a navbar, in FW4, with one button having a popup menu. I then imported into DW4 and previewed in IE 4,5,6 and Netscape4,5,6. Everything's looks great!

Then, in DW I centered the entire structure but when previewing in IE all tables centered correctly, including the navbar, but when I rolled my mouse over the button that had the pop-up menu, the menu was off to the left of the button it's supposed to be over. (In otherwords the popup menu did not [center] move with it's roll-over button)

2nd part to this is, when previewing in IE & Net from FW the pop-up menu is under the roll-over button

When previewing in IE & Net from DW, the popup menu is on the top of the roll-over button

Here's the code:

== begin code ==
<script language="JavaScript">
<!--
function MM_findObj(n, d) { //v3.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); return x;
}
function MM_nbGroup(event, grpName) { //v3.0
var i,img,nbArr,args=MM_nbGroup.arguments;
if (event == "init" && args.length > 2) {
if ((img = MM_findObj(args[2])) != null && !img.MM_init) {
img.MM_init = true; img.MM_up = args[3]; img.MM_dn = img.src;
if ((nbArr = document[grpName]) == null) nbArr = document[grpName] = new Array();
nbArr[nbArr.length] = img;
for (i=4; i < args.length-1; i+=2) if ((img = MM_findObj(args[i])) != null) {
if (!img.MM_up) img.MM_up = img.src;
img.src = img.MM_dn = args[i+1];
nbArr[nbArr.length] = img;
} }
} else if (event == "over") {
document.MM_nbOver = nbArr = new Array();
for (i=1; i < args.length-1; i+=3) if ((img = MM_findObj(args[i])) != null) {
if (!img.MM_up) img.MM_up = img.src;
img.src = (img.MM_dn && args[i+2]) ? args[i+2] : args[i+1];
nbArr[nbArr.length] = img;
}
} else if (event == "out" ) {
for (i=0; i < document.MM_nbOver.length; i++) {
img = document.MM_nbOver[i]; img.src = (img.MM_dn) ? img.MM_dn : img.MM_up; }
} else if (event == "down") {
if ((nbArr = document[grpName]) != null)
for (i=0; i < nbArr.length; i++) { img=nbArr[i]; img.src = img.MM_up; img.MM_dn = 0; }
document[grpName] = nbArr = new Array();
for (i=2; i < args.length-1; i+=2) if ((img = MM_findObj(args[i])) != null) {
if (!img.MM_up) img.MM_up = img.src;
img.src = img.MM_dn = args[i+1];
nbArr[nbArr.length] = img;
} }
}

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 fwLoadMenus() {
if (window.fw_menu_0) return;
window.fw_menu_0 = new Menu("root",132,19,"Verdana, Arial, Helvetica, sans-serif",12,"#ffffff","#ffffff","#e8b480","#734234");
fw_menu_0.addMenuItem("Web Site Design","location='services.htm'");
fw_menu_0.addMenuItem("Re-design","window.open('services.htm#redesign', '_self');");
fw_menu_0.addMenuItem("eCommerce","window.open('services.htm#storefront', '_self');");
fw_menu_0.addMenuItem("Hosting","window.open('hosting.htm', '_self');");
fw_menu_0.addMenuItem("Maintenance","window.open('maint.htm', '_self');");
fw_menu_0.hideOnMouseOut=true;

fw_menu_0.writeMenus();
} // fwLoadMenus()

//-->
</script>

== end code ==

Any help that anyone can give will be greatly appreciated.

- HiTekMom

zachzach
12-24-2003, 11:34 AM
instead of absolute positioning, do relative positioning.It takes your initial absolute positon and adds, or subtracts, how far up/down to the left/top you want to go, from that initial positioning.i dont know that much about it

hitekmom
12-24-2003, 01:32 PM
I think you are right. I believe the problem is in the {absolute positioning;left} which I didn't change when I centered the table.

I don't know JS and will have to play with the coding. The script has tons of positioning;left that could be the problem child.

Thx much,
HiTekMom

zachzach
12-24-2003, 01:50 PM
its not JS....its in the style="position:relative" attribute(css)

hitekmom
12-24-2003, 05:07 PM
Thank you!