...

View Full Version : How do I Make My Menu Stay Put?



InertiacticESP
01-20-2006, 05:00 PM
I am having trouble with a menu placement.

This is the page I'm trying to put the menu on:
http://www.guitarpartsresource.com/guitar_index_coolmenu2.htm


This is the example i'm drawing from:
http://www.guitarpartsresource.com/coolmenus/table_placement1.html

In the original one, it's positioned to the left, but I need it on the right, within the black area. I am having trouble making it stay where it is when the window is resized, refreshed, screen resolution changed, etc. Is there any way I can make it stay where I want it?

I tried to go back to the website where i got the scripts: dhtmlcentral.com for help but it has vanished.

Any idea what's going on?

:confused:

vwphillips
01-20-2006, 05:13 PM
normally if the menu has absolue positioning, position the menu at anchor point coordinates <a id="MyAnchor" ></a>
and reposition at anchor when resizing

Have not unraveled the specific code but would hope that the submenus are relative to the menu.

problem is identifying the menu object.

InertiacticESP
01-20-2006, 06:15 PM
i forgot to include the relevant bit of code:

//Menu object creation
oCMenu=new makeCM("oCMenu") //Making the menu object. Argument: menuname

//Menu properties
oCMenu.pxBetween=0
//Using the cm_page object to place the menu ----
//There are some differences between the browsers that I try to fix here.
oCMenu.fromLeft=!bw.ns4?cmpage.x2 - 950:cmpage.x2 - 740
//We also need to "replace" the menu on resize. So:
oCMenu.onresize="oCMenu.fromRight=cmpage.x2 - 24"


oCMenu.fromTop=193
oCMenu.rows=0
oCMenu.menuPlacement=0

oCMenu.offlineRoot="file:///C|/Inetpub/wwwroot/dhtmlcentral/projects/coolmenus/examples/"
oCMenu.onlineRoot="/coolmenus/"
oCMenu.resizeCheck=1
oCMenu.wait=1000
oCMenu.fillImg="cm_fill.gif"
oCMenu.zIndex=0

vwphillips
01-20-2006, 06:29 PM
put an onload event call to function Test()

example


<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">

<html>

<head>
<title></title>
<script language="JavaScript" type="text/javascript">
<!--
function Test(){
alert(document.getElementById('oCMenu').offsetLeft+'\n'+document.getElementById('oCMenu').offsetTop) ;

}
//-->
</script>
</head>

<body onload="Test();">

</body>

</html>

if answer not sensible you will need to read the script help files

InertiacticESP
01-20-2006, 07:07 PM
;) That helped some, thanks! I'm still having some problems though...

1. If the window is resized and then refreshed the menu disappears.
2. It doesn't show up at all in the 800 x 600 resolution.

I'm not sure which set of numbers to set to which position

my page:

oCMenu.fromLeft=!bw.ns4?cmpage.x2 - 950:cmpage.x2 - 740
//We also need to "replace" the menu on resize. So:
oCMenu.onresize="oCMenu.fromRight=cmpage.x2 - 24"


the example page:

oCMenu.fromLeft=!bw.ns4?cmpage.x2 - 160:cmpage.x2 - 176
//We also need to "replace" the menu on resize. So:
oCMenu.onresize="oCMenu.fromLeft=cmpage.x2 - 160"



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum