okej, nu kommer hela koden... (det står att namnet måste vara unikt... men fattar ju inte :()
<script language="JavaScript1.2" src="coolmenus.js">
/*******************************************************************************
Copyright (c) 1999 Thomas Brattli (www.bratta.com)
eXperience DHTML coolMenus - Get it at [url="http://www.bratta.com"]www.bratta.com[/url]
Version 2.0
This script can be used freely as long as all copyright messages are
intact. Visit [url="http://www.bratta.com/dhtml"]www.bratta.com/dhtml[/url] 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!
********************************************************************************/
[b]//Making a menu object
oMenu=new menuObj('oMenu') //Place a name for the menu in there. Must be uniqe for each menu
[/b]
//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; text-align:center' //The style for the main menus
oMenu.clSub='padding:5px; font-family:verdana; font-size:10px; text-align:center' //The style for the submenus
oMenu.clSubSub='padding:5px; font-family:verdana; font-size:10px; text-align:center' //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-20 //** NEW ** The X placement of the subsubmenus, relative to the sub item
oMenu.subsubYplacement=5 //** 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=1 //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
//Example in px: (remember to use the ' ' around the numbers)
//oMenu.menuplacement=new Array(10,200,300,400,500)
//Example right beside eachother (only adding the pxbetween variable)
oMenu.menuplacement=0
//If you use the "right beside eachother" you cant how many pixel there should be between each here
oMenu.pxbetween=50 //in pixel or %
//And you can set where it should start from the left here
//Center aligned example: (page.x2==pageWidth)
numberofmenus=3
menutotalwidth=oMenu.mainwidth*numberofmenus+oMenu.pxbetween*(numberofmenus-1)
oMenu.fromleft=page.x50-menutotalwidth/2 //in pixel or %
//Righ align the backgroundbar aswell:
oMenu.backgroundbarfromleft=oMenu.fromleft
//If you want the backgroundbar to be the same size:
oMenu.backgroundbarsize=menutotalwidth
//This is how much from the top the menu should be.
oMenu.fromtop=0 //in pixel or %
/********************************************************************************
Construct your menus below
********************************************************************************/
//MAIN 0
//Main items:
// makeMain(MAIN_NUM,'TEXT','LINK') (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) (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)
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>
hmmm...raden det är fel på = markerad med fetstil
------------------
grodan -besök den nu!!!