Newsgroup: it.comp.lang.javascript
Titolo: aiuto: modificare layer ad un menu

è una settimana che vi assillo con il mio problema e a piccoli passi, grazie
ai vostri aiuti, sto riuscendo nella realizzazione di un menu orizzontale.
Mi è stato suggerito di modificare il layer del seguente script per poter
usare 2 frame (1 sopra di navigazione + 1 di consultazione..)
come devo agire...scusate ma non riesco proprio?
Vi spedisco lo script chiedendo (se avete del tempo e voglia) di darmi
l'imbeccata finale...mi fareste un favore incredibile.
<html>
<head>
 <title>eXperience DHTML CoolMenus - DHTML Menu example 5</title>
</head>
<body>
<script language="JavaScript1.2" src="coolmenus.js">
/***************************************************************************
****
Copyright (c) 1999 Thomas Brattli (
www.bratta.com
)
eXperience DHTML coolMenus - Get it at 
www.bratta.com
Version 2.0
This script can be used freely as long as all copyright messages are
intact. Visit 
www.bratta.com/dhtml
 for the latest version of the script.
These are the varibles you have to set to customize the menu.
****************************************************************************
***/
</script>
<script>
/***************************************************************************
*****
Variables to set.
Remember that to set fontsize and fonttype you set that in the stylesheet
above!
****************************************************************************
****/
//Making a menu object
oMenu=new menuObj('oMenu') //Place a name for the menu in there. Must be
uniqe for each menu
//Setting menu object variables
//Style variables NOTE: The stylesheet have been removed. Use this instead!
(some styles are there by default, like position:absolute ++)
oMenu.clMain='padding:5px; font-family:verdana; font-size:12px;
font-weight:bold' //The style for the main menus
oMenu.clSub='padding:5px; font-family:verdana; font-size:10px' //The style
for the submenus
oMenu.clSubSub='padding:5px; font-family:verdana; font-size:10px' //The
style for the subsubmenus
oMenu.clAMain='text-decoration:none; color:White' //The style for the main
links
oMenu.clASub='text-decoration:none; color:White' //The style for the sub
links
oMenu.clASubSub='text-decoration:none; color:White' //The style for the
subsub links
//Background bar properties
oMenu.backgroundbar=1 //Set to 0 if no backgroundbar
oMenu.backgroundbarfromleft=0 //The left placement of the backgroundbar in
pixel or %
oMenu.backgroundbarfromtop=0 //The top placement of the backgroundbar  in
pixel or %
oMenu.backgroundbarsize="100%" //The size of the bar in pixel or %
oMenu.backgroundbarcolor="Navy" //The backgroundcolor of the bar
oMenu.mainheight=25 //The height of the main menuitems in pixel or %
oMenu.mainwidth=130 //The width of the main menuitems  in pixel or %
/*These are new variables. In this example they are set like the previous
version*/
oMenu.subwidth=oMenu.mainwidth // ** NEW ** The width of the submenus
oMenu.subheight=20 //The height if the subitems in pixel or %
oMenu.subsubwidth=oMenu.mainwidth // ** NEW ** The width of the subsubmenus
in pixel or %
oMenu.subsubheight=oMenu.subheight //** NEW ** The height if the subsubitems
in pixel or %
//Writing out the style for the menu (leave this line!)
oMenu.makeStyle()
oMenu.subplacement=oMenu.mainheight //** NEW ** Relative to the main item
oMenu.subsubXplacement=oMenu.subwidth/2 //** NEW ** The X placement of the
subsubmenus, relative to the sub item
oMenu.subsubYplacement=7 //** NEW ** The Y placement of the subsubmenus,
relative to the sub item
oMenu.mainbgcoloroff='Navy' //The backgroundcolor of the main menuitems
oMenu.mainbgcoloron='#996699' //The backgroundcolor on mouseover of the main
menuitems
oMenu.subbgcoloroff='#006699' //The backgroundcolor of the sub menuitems
oMenu.subbgcoloron='#9966cc' //The backgroundcolor on mouseover of the sub
menuitems
oMenu.subsubbgcoloroff='#003399' //The backgroundcolor of the subsub
menuitems
oMenu.subsubbgcoloron='#996666' //The backgroundcolor on mouseover of the
subsub menuitems
oMenu.stayoncolor=0 //Do you want the menus to stay on the mouseovered color
when clicked?
oMenu.menuspeed=10 //The speed of the clipping in px
oMenu.menusubspeed=15 //The speed of the submenus clipping in px
oMenu.menurows=1 //Set to 0 if you want rows and to 1 if you want columns
oMenu.menueventon="mouse" //Set this to "mouse" if you want the menus to
appear onmouseover, set it to "click" if you want it to appear onclick
oMenu.menueventoff="mouse" //Set this to "mouse" if you them to disappear
onmouseout, if not set it to "click"
//Placement of the menuitems
//Example in %:
//oMenu.menuplacement=new Array("20%","40%","60%","50%","65%") //Remember to
make the arrays contain as many values as you have main menuitems
file://Example in px: (remember to use the ' ' around the numbers)
file://oMenu.menuplacement=new Array(10,200,300,400,500)
file://Example right beside eachother (only adding the pxbetween variable)
oMenu.menuplacement=0
file://If you use the "right beside eachother" you cant how many pixel there
should be between each here
oMenu.pxbetween=0 file://in pixel or %
file://And you can set where it should start from the left here
oMenu.fromleft=0 file://in pixel or %
file://This is how much from the top the menu should be.
oMenu.fromtop=0 file://in pixel or %
/***************************************************************************
*****
Construct your menus below
****************************************************************************
****/
//MAIN 0
//Main items:
// makeMain(MAIN_NUM,'TEXT','LINK','FRAME_TARGET') (set link to 0 if you
want submenus of this menu item)
oMenu.makeMain(0,'Dynamic HTML',0)
 //Sub items:
 // makeSub(MAIN_NUM,SUB_NUM,'TEXT','LINK',TOTAL,'FRAME_TARGET') (set link
to 0 if you want submenus of this menu item)
 oMenu.makeSub(0,0,'Scripts',0,5)
 oMenu.makeSub(0,1,'Demos',0,5)
 oMenu.makeSub(0,2,'Support',0,5)
 oMenu.makeSub(0,3,'Tutorials',0,5)
 oMenu.makeSub(0,4,'Forums',0,5)
  //SubSub items:
  //
makeSubSub(MAIN_NUM,SUB_NUM,SUBSUB_NUM,'TEXT','LINK',TOTAL,'FRAME_TARGET')
  oMenu.makeSubSub(0,0,0,'ZoomFade','#',7)
  oMenu.makeSubSub(0,0,1,'ScrollText','#',7)
  oMenu.makeSubSub(0,0,2,'PageScroll','#',7)
  oMenu.makeSubSub(0,0,3,'Foldoutmenu','#',7)
  oMenu.makeSubSub(0,0,4,'Spotlight','#',7)
  oMenu.makeSubSub(0,0,5,'Bgchange','#',7)
  oMenu.makeSubSub(0,0,6,'Showhide','#',7)
  oMenu.makeSubSub(0,1,0,'DHTML Guestbook','#',6)
  oMenu.makeSubSub(0,1,1,'DHTML Intro','#',6)
  oMenu.makeSubSub(0,1,2,'CircleMenu','#',6)
  oMenu.makeSubSub(0,1,3,'DHTML Space 1.0','#',6)
  oMenu.makeSubSub(0,1,4,'Old site 4','#',6)
  oMenu.makeSubSub(0,1,5,'BallControl','#',6)
  oMenu.makeSubSub(0,2,0,'Site FAQ','#',2)
  oMenu.makeSubSub(0,2,1,'Scripts FAQ','#',2)
  oMenu.makeSubSub(0,3,0,'Introduction','#',3)
  oMenu.makeSubSub(0,3,1,'5th generation','#',3)
  oMenu.makeSubSub(0,3,2,'Keyboard','#',3)
  oMenu.makeSubSub(0,4,0,'Forum 1','test.html',2)
  oMenu.makeSubSub(0,4,1,'Forum 2','test.html',2)
//MAIN 1
oMenu.makeMain(1,'Help',0)
 oMenu.makeSub(1,0,'How do I do this?',0,3)
 oMenu.makeSub(1,1,'How? (no submenu)',0,3)
 oMenu.makeSub(1,2,'Why does it work?',0,3)
  oMenu.makeSubSub(1,0,0,'Like this part 1','test.html',3)
  oMenu.makeSubSub(1,0,1,'Like this part 2','test.html',3)
  oMenu.makeSubSub(1,0,2,'Like this part 3','test.html',3)
  oMenu.makeSubSub(1,2,0,'Forum 1','test.html',2)
  oMenu.makeSubSub(1,2,1,'Forum 2','test.html',2)
//MAIN 2
oMenu.makeMain(2,'Links',0)
 oMenu.makeSub(2,0,'Yahoo',0,2)
 oMenu.makeSub(2,1,'Altavista','#',2)
  oMenu.makeSubSub(2,0,0,'Yahoo Norway','#',3)
  oMenu.makeSubSub(2,0,1,'Yahoo US','#',3)
  oMenu.makeSubSub(2,0,2,'Yahoo UK','#',3)
/***************************************************************************
*****
End menu construction
****************************************************************************
****/
//When all the menus are written out we initiates the menu
oMenu.construct()
</script>
</body>
</html>
Ringrazio in anticipo tutti, anche coloro che non avessero voglia di
rispondermi
MARCO

mancano riferimenti importanti dal codice che hai
postato:
dove sono i layer ed i sublayer dei menu' ??
cosa fa coolmenus.js ??
non č impossibile fare un menu' dinamico con
la base in un frame e lo sviluppo in un altro frame,
ma neanche facile ...
inoltre se lo dovessi fare, userei la libreria dhtml,
e su quella con altre funzioni implementerei
il menů ..
--
Bye
Ro<*ż*>berto