Avatar billede redhead Nybegynder
20. august 2001 - 20:12 Der er 11 kommentarer og
1 løsning

TV2 menu - Skal virke 100% - HASTER!!!

Jeg skal bruge en TV2 menu, og det skal helst være hurtigt, meget hurtigt. Den skal være nem at sætte ind, da jeg er minus god til JavaScript. Den må heller ikke ligge i toppen af siden, men skal ligge ligesom TV2\'s/DR\'s menu, jeg skal dog selv kunne bestemme (meget let) hvor den skal sidde.
Avatar billede jiggypoof Nybegynder
20. august 2001 - 20:17 #1
<html>
<head>
    <title>Cross-browser Dynamic HTML Scripts - NewsMenu</title>
<style type=\"text/css\">
DIV.clTopMenu{position:absolute; width:101; height:150; clip:rect(0,101,14,0); visibility:hidden; z-index:31; layer-background-color:#EEEEEE; background-color:#EEEEEE}
DIV.clTopMenuBottom{position:absolute; width:101; height:3; clip:rect(0,101,3,0); top:11; layer-background-color:#CECFCE; background-color:#CECFCE; z-index:2}
DIV.clTopMenuText{position:absolute; width:91; left:5; top:15; font-family:arial,helvetica; font-size:11px; background-color:#EEEEEE; z-index:1}

</style>
<script type=\"text/javascript\" language=\"JavaScript\">
/********************************************************************************
Copyright (C) 1999 Thomas Brattli
This script is made by and copyrighted to Thomas Brattli at www.bratta.com
Visit for more great scripts. This may be used freely as long as this msg is intact!
I will also appriciate any links you could give me.
********************************************************************************/
//Default browsercheck, added to all scripts!
function checkBrowser(){
    this.ver=navigator.appVersion
    this.dom=document.getElementById?1:0
    this.ie5=(this.ver.indexOf(\"MSIE 5\")>-1 && this.dom)?1:0;
    this.ie4=(document.all && !this.dom)?1:0;
    this.ns5=(this.dom && parseInt(this.ver) >= 5) ?1:0;
    this.ns4=(document.layers && !this.dom)?1:0;
    this.bw=(this.ie5 || this.ie4 || this.ns4 || this.ns5)
    return this
}
bw=new checkBrowser()
/********************************************************************************
If you want to change the appearens on the text, background-colors, size or
anything do that in the style tag above.

This menu might not be as easy to adapt to your own site, but please
play around with it before you mail me for help...
****************************************************************************/

/***************************************************************************
Variables to set.
****************************************************************************/

//There are 2 ways these menus can be placed
// 0 = column
// 1 = row
nPlace=0


//How many menus do you have? (remember to copy and add divs in the body if you add menus)
var nNumberOfMenus=2

var nMwidth=101 //The width on the menus (set the width in the stylesheet as well)
var nPxbetween=20 //Pixels between the menus
var nFromleft=10 //The first menus left position
var nFromtop=85 //The top position of the menus
var nBgcolor=\'#CECFCE\' //The bgColor of the bottom mouseover div
var nBgcolorchangeto=\'#6380BC\' //The bgColor to change to
var nImageheight=11 //The position the mouseover line div will stop at when going up!

/***************************************************************************
You shouldn\'t have to change anything below this
****************************************************************************/
//Object constructor
function makeNewsMenu(obj,nest){
    nest=(!nest) ? \'\':\'document.\'+nest+\'.\'                   
      this.css=bw.dom? document.getElementById(obj).style:bw.ie4?document.all[obj].style:bw.ns4?eval(nest+\"document.layers.\" +obj):0;       
    this.evnt=bw.dom? document.getElementById(obj):bw.ie4?document.all[obj]:bw.ns4?eval(nest+\"document.layers.\" +obj):0;           
    this.scrollHeight=bw.ns4?this.css.document.height:this.evnt.offsetHeight
    this.moveIt=b_moveIt;this.bgChange=b_bgChange;
    this.slideUp=b_slideUp; this.slideDown=b_slideDown;
    this.clipTo=b_clipTo;
    this.obj = obj + \"Object\";     eval(this.obj + \"=this\")       
}
//Objects methods
function b_moveIt(x,y){this.x=x; this.y=y; this.css.left=this.x; this.css.top=this.y}
function b_bgChange(color){if(bw.dom || bw.ie4) this.css.backgroundColor=color; else this.css.bgColor=color}
function b_clipTo(t,r,b,l){
    if(bw.ns4){this.css.clip.top=t; this.css.clip.right=r; this.css.clip.bottom=b; this.css.clip.left=l
    }else this.css.clip=\"rect(\"+t+\",\"+r+\",\"+b+\",\"+l+\")\";
}
function b_slideUp(ystop,moveby,speed,fn,wh){
    if(!this.slideactive){
        if(this.y>ystop){
            this.moveIt(this.x,this.y-5); eval(wh)
            setTimeout(this.obj+\".slideUp(\"+ystop+\",\"+moveby+\",\"+speed+\",\'\"+fn+\"\',\'\"+wh+\"\')\",speed)
        }else{
            this.slideactive=false; this.moveIt(0,ystop); eval(fn)
        }
    }
}
function b_slideDown(ystop,moveby,speed,fn,wh){
    if(!this.slideactive){
        if(this.y<ystop){
            this.moveIt(this.x,this.y+5); eval(wh)
            setTimeout(this.obj+\".slideDown(\"+ystop+\",\"+moveby+\",\"+speed+\",\'\"+fn+\"\',\'\"+wh+\"\')\",speed)
        }else{
            this.slideactive=false; this.moveIt(0,ystop); eval(fn)
        }
    }
}
//Initiating the page, making cross-browser objects
function newsMenuInit(){
    oTopMenu=new Array()
    zindex=10
    for(i=0;i<=nNumberOfMenus;i++){
        oTopMenu[i]=new Array()
        oTopMenu[i][0]=new makeNewsMenu(\'divTopMenu\'+i)
        oTopMenu[i][1]=new makeNewsMenu(\'divTopMenuBottom\'+i,\'divTopMenu\'+i)
        oTopMenu[i][2]=new makeNewsMenu(\'divTopMenuText\'+i,\'divTopMenu\'+i)
        oTopMenu[i][1].moveIt(0,nImageheight)
        oTopMenu[i][0].clipTo(0,nMwidth,nImageheight+3,0)
        if(!nPlace) oTopMenu[i][0].moveIt(i*nMwidth+nFromleft+(i*nPxbetween),nFromtop)
        else{
            oTopMenu[i][0].moveIt(nFromleft,i*nImageheight+nFromtop+(i*nPxbetween))
            oTopMenu[i][0].css.zIndex=zindex--
        }
        oTopMenu[i][0].css.visibility=\"visible\"
    }
}
//Moves the menu
function topMenu(num){
    if(oTopMenu[num][1].y==nImageheight) oTopMenu[num][1].slideDown(oTopMenu[num][2].scrollHeight+20,10,40,\'oTopMenu[\'+num+\'][0].clipTo(0,nMwidth,oTopMenu[\'+num+\'][1].y+3,0)\',\'oTopMenu[\'+num+\'][0].clipTo(0,nMwidth,oTopMenu[\'+num+\'][1].y+3,0)\')
    else if(oTopMenu[num][1].y==oTopMenu[num][2].scrollHeight+20) oTopMenu[num][1].slideUp(nImageheight,10,40,\'oTopMenu[\'+num+\'][0].clipTo(0,nMwidth,oTopMenu[\'+num+\'][1].y+3,0)\',\'oTopMenu[\'+num+\'][0].clipTo(0,nMwidth,oTopMenu[\'+num+\'][1].y+3,0)\')
}
//Changes background onmouseover
function menuOver(num){oTopMenu[num][1].bgChange(nBgcolorchangeto)}
function menuOut(num){oTopMenu[num][1].bgChange(nBgcolor)}

//Calls the init function onload
onload=newsMenuInit;
</script>
</HEAD>
<BODY bgcolor=\"White\">
<!-- Remember the \"news\" \"key control\" and \"page contols\" text are images, you probably want to change those
with your own images. If your own images have different sizes please adjust the height and clips
of the divs, and change the nImageheight variable in the script. Good luck -->
<div id=\"divTopMenu0\" class=\"clTopMenu\"><a href=\"#\" onmouseover=\"menuOver(0)\" onmouseout=\"menuOut(0)\" onclick=\"topMenu(0); if(bw.dom || bw.ie4)this.blur(); return false\"><img src=\"images/news.gif\" width=101 height=11 alt=\"\" border=0 align=\"top\"></a>
    <div id=\"divTopMenuText0\" class=\"clTopMenuText\">
        Added some link to me buttons and
        advertising info and a new script and a new tutorial.<br><br>
        Remember to join the newsletter!
    </div>
    <div id=\"divTopMenuBottom0\" class=\"clTopMenuBottom\"></div>
</div>

<div id=\"divTopMenu1\" class=\"clTopMenu\"><a href=\"#\" onmouseover=\"menuOver(1)\" onmouseout=\"menuOut(1)\" onclick=\"topMenu(1); if(bw.dom || bw.ie4)this.blur(); return false\"><img src=\"images/keycontrol.gif\" width=101 height=11 alt=\"\" border=0 align=\"top\"></a>
    <div id=\"divTopMenuText1\" class=\"clTopMenuText\">
        1-6=Menu controls<br>
        M=Menuchange<br>
        N=News<br>
        K=Key controls<br>
        P=Page control<br>
        A=Scroll down<br>
        Z=Scroll up<br>
        S=Scriptomania<br><br>
    </div>
    <div id=\"divTopMenuBottom1\" class=\"clTopMenuBottom\"></div>
</div>
<div id=\"divTopMenu2\" class=\"clTopMenu\"><a href=\"#\" onmouseover=\"menuOver(2)\" onmouseout=\"menuOut(2)\" onclick=\"topMenu(2); if(bw.dom || bw.ie4)this.blur(); return false\"><img src=\"images/pagecontrol.gif\" width=101 height=11 alt=\"\" border=0 align=\"top\"></a>
    <div id=\"divTopMenuText2\" class=\"clTopMenuText\">
        Text here.
    </div>
    <div id=\"divTopMenuBottom2\" class=\"clTopMenuBottom\"></div>
</div>
<!-- To add a new menu just copy these lines:
<div id=\"divTopMenuN\" class=\"clTopMenu\"><a href=\"#\" onmouseover=\"menuOver(N)\" onmouseout=\"menuOut(N)\" onclick=\"topMenu(N); if(ie)this.blur(); return false\">HEADING IMAGE GOES HERE</a>
    <div id=\"divTopMenuTextN\" class=\"clTopMenuText\">
        TEXT HERE   
    </div>
    <div id=\"divTopMenuBottomN\" class=\"clTopMenuBottom\"></div>
</div>
And change the letter N to a number higher then the last menu...
(and remember to set the variable nNumberOfMenus in the script to
the same number of menus you have (remember it starts counting
at 0) --><br><br>

YOUR REGULAR BODY CONTENT GOES IN HERE
</BODY>
</HTML>




Avatar billede redhead Nybegynder
20. august 2001 - 20:25 #2
Det skal være en TV2 menu, som popper nedad når man kører musen henover...
Avatar billede jiggypoof Nybegynder
20. august 2001 - 20:27 #3
<html>
<head>
    <title>Coolmenus example - CoolMenus3 DHTML script made by Thomas Brattli from DHTMLCentral.com. Visit for more great scripts.</title>
</head>
<body>
<script language=\"JavaScript1.2\" src=\"../coolmenus3.js\">
/*****************************************************************************
Copyright (c) 2001 Thomas Brattli (www.bratta.com)

eXperience DHTML coolMenus - Get it at www.bratta.com
Version 3.02
This script can be used freely as long as all copyright messages are
intact.
******************************************************************************/
</script>
<script>
/*****************************************************************************
Default browsercheck - Leave this one
******************************************************************************/
function lib_bwcheck(){ //Browsercheck (needed)
    this.ver=navigator.appVersion; this.agent=navigator.userAgent
    this.dom=document.getElementById?1:0
    this.ie5=(this.ver.indexOf(\"MSIE 5\")>-1 && this.dom)?1:0;
    this.ie6=(this.ver.indexOf(\"MSIE 6\")>-1 && this.dom)?1:0;
    this.ie4=(document.all && !this.dom)?1:0;
    this.ie=this.ie4||this.ie5||this.ie6
    this.mac=this.agent.indexOf(\"Mac\")>-1
    this.opera5=this.agent.indexOf(\"Opera 5\")>-1
    this.ns6=(this.dom && parseInt(this.ver) >= 5) ?1:0;
    this.ns4=(document.layers && !this.dom)?1:0;
    this.bw=(this.ie6 || this.ie5 || this.ie4 || this.ns4 || this.ns6 || this.opera5 || this.dom)
    return this
}
var bw=new lib_bwcheck() //Making browsercheck object

var mDebugging=2 //General debugging variable. Set to 0 for no debugging, 1 for alerts or 2 for status debugging.

oCMenu=new makeCoolMenu(\"oCMenu\") //Making the menu object. Argument: menuname
oCMenu.useframes=0 //Do you want to use the menus as coolframemenu or not? (in frames or not) - Value: 0 || 1
oCMenu.frame=\"frmMain\" //The name of your main frame (where the menus should appear). Leave empty if you\'re not using frames - Value: \"main_frame_name\"

oCMenu.useclick=0 //If you want the menu to be activated and deactivated onclick only set this to 1. - Value: 0 || 1

/*If you set this to 1 you will get a \"hand\" cursor when moving over the links in NS4.
NOTE: This does not apply to the submenus if the menu is used in frames due some mayor problems with NS4*/
oCMenu.useNS4links=1 

//After adding the \"hover effect\" for netscape as well, all styles are lost. But if you want padding add it here.
oCMenu.NS4padding=2

//If you have select boxes close to your menu the menu will check for that and hide them if they are in the way of the menu.
//This feature does unfortunatly not work in NS4!
oCMenu.checkselect=0

/*If you choose to have this code inside a linked js, or if your using frames it\'s important to set these variables.
This will help you get your links to link to the right place even if your files are in different folders.
The offlineUrl variable is the actual path to the directory where you js file are locally.
This is just so you can test it without uploading. Remember to start it with file:/// and only use slashes, no backward slashes!
Also remember to end with a slash                                                                                                */
oCMenu.offlineUrl=\"file:///C|/Inetpub/wwwroot/dhtmlcentral/\" //Value: \"path_to_menu_file_offline/\"
//The onlineUrl variable is the online path to your script. Place in the full path to where your js file is. Remember to end with a slash.
oCMenu.onlineUrl=\"http://www.dhtmlcentral.com/coolmenus/examples/withoutframes/\" //Value: \"path_to_menu_file_online/\"

oCMenu.pagecheck=1 //Do you want the menu to check whether any of the subitems are out of the bouderies of the page and move them in again (this is not perfect but it hould work) - Value: 0 || 1
oCMenu.checkscroll=1 //Do you want the menu to check whether the page have scrolled or not? For frames you should always set this to 1. You can set this to 2 if you want this feature only on explorer since netscape doesn\'t support the window.onscroll this will make netscape slower (only if not using frames) - Value: 0 || 1 || 2
oCMenu.resizecheck=1 //Do you want the page to reload if it\'s resized (This should be on or the menu will crash in Netscape4) - Value: 0 || 1
oCMenu.wait=1000 //How long to wait before hiding the menu on mouseout. Netscape 6 is a lot slower then Explorer, so to be sure that it works good enough there you should not have this lower then 500 - Value: milliseconds

//Background bar properties
oCMenu.usebar=1 //If you want to use a background-bar for the top items set this on - Value: 1 || 0
oCMenu.barcolor=\"Navy\" //The color of the background bar - Value: \"color\"
oCMenu.barwidth=\"100%\" //The width of the background bar. Set this to \"menu\" if you want it to be the same width as the menu. (this will change to match the border if you have one) - Value: px || \"%\" || \"menu\"
oCMenu.barheight=\"menu\" //The height of the background bar. Set this to \"menu\" if you want it to be the same height as the menu. (this will change to match the border if you have one) - Value: px || \"%\" || \"menu\"
oCMenu.barx=0 //The left position of the bar. Set this to \"menu\" if you want it be the same as the left position of the menu. (this will change to match the border if you have one)  - Value: px || \"%\" || \"menu\"
oCMenu.bary=0 //The top position of the bar Set this to \"menu\" if you want it be the same as the top position of the menu. (this will change to match the border if you have one)  - Value: px || \"%\" || \"menu\"
oCMenu.barinheritborder=0 //Set this to 1 if you want the bar to have the same border as the top menus - Value: 0 || 1

//Placement properties
oCMenu.rows=1 //This controls whether the top items is supposed to be laid out in rows or columns. Set to 0 for columns and 1 for row - Value 0 || 1
oCMenu.fromleft=20 //This is the left position of the menu. (Only in use if menuplacement below is 0 or aligned) (will change to adapt any borders) - Value: px || \"%\"
oCMenu.fromtop=0 //This is the left position of the menu. (Only in use if menuplacement below is 0 or aligned) (will change to adapt any borders) - Value: px || \"%\"
oCMenu.pxbetween=30 //How much space you want between each of the top items. - Value: px || \"%\"

/*You have several different ways to place the top items.
You can have them right beside eachother (only adding the pxbetween variable)
oCMenu.menuplacement=0

You can have them aligned to one of the sides - This is mostly when not using frames, but can be used in both conditions
Values: (If you get strange results check the fromleft,fromtop and pxbetween variables above)
For menus that are placed in columns (align=left or align=right (se below)) you can align them to the \"right\" or \"center\"
For menus that are placed in rows (align=top or align=bottom (se below)) you can align them to the \"bottom\", \"center\" or \"bottomcenter\"
oCMenu.menuplacement=\"center\"

You can also set them directly in pixels: (Remember to have as many array members as you have top items)
oCMenu.menuplacement=new Array(10,200,400,600)

Or you can place in percentage: (remember to use the \' \' around the numbers)


Choose one of those options to get the desired results.
*/
oCMenu.menuplacement=new Array(\'2%\',\'20%\',\'36%\',\'57%\',\'70%\',\'80%\')

/*
Now we are ready for the properties of each level. For those of that have used the old
coolmenus for coolframemenu I will try and explain how this works like this:
level[0] = top items
level[1] = sub items
level[2] = sub2 items
level[3] = sub3 items and so on....
All menus will inherit the properties, and all properties does only HAVE to be spesifed on the top level.
If a level doesn\'t have on property spesified it will look for it on the last level that was spesified,
if it still doesn\'t exist it will get the properties from level[0]

Which means that if you set the background color on level[0] to \"black\" and doesn\'t spesify any more levels or doesn\'t
spesify the background color on the last level you spesified ALL menus will get the color from level[0]

Did that make sense at all? This can be a little hard to understand, look at the different examples on my site
and play with and I am sure you\'ll get what I mean.
*/

//TOP LEVEL PROPERTIES - ALL OF THESE MUST BE SPESIFIED FOR LEVEL[0]
oCMenu.level[0]=new Array() //Add this for each new level
oCMenu.level[0].width=110 //The default width for each level[0] (top) items. You can override this on each item by spesifying the width when making the item. - Value: px || \"%\"
oCMenu.level[0].height=25 //The default height for each level[0] (top) items. You can override this on each item by spesifying the height when making the item. - Value: px || \"%\"
oCMenu.level[0].bgcoloroff=\"Navy\" //The default background color for each level[0] (top) items. You can override this on each item by spesifying the backgroundcolor when making the item. - Value: \"color\"
oCMenu.level[0].bgcoloron=\"#336699\" //The default \"on\" background color for each level[0] (top) items. You can override this on each item by spesifying the \"on\" background color when making the item. - Value: \"color\"
oCMenu.level[0].textcolor=\"White\" //The default text color for each level[0] (top) items. You can override this on each item by spesifying the text color when making the item. - Value: \"color\"
oCMenu.level[0].hovercolor=\"Yellow\" //The default \"on\" text color for each level[0] (top) items. You can override this on each item by spesifying the \"on\" text color when making the item. - Value: \"color\"
oCMenu.level[0].style=\"padding:2px; font-family:tahoma,arial,helvetica; font-size:12px; font-weight:bold\" //The style for all level[0] (top) items. - Value: \"style_settings\"
oCMenu.level[0].border=0 //The border size for all level[0] (top) items. - Value: px
oCMenu.level[0].bordercolor=\"red\" //The border color for all level[0] (top) items. - Value: \"color\"
oCMenu.level[0].offsetX=0 //The X offset of the submenus of this item. This does not affect the first submenus, but you need it here so it can be the default value for all levels. - Value: px
oCMenu.level[0].offsetY=-1 //The Y offset of the submenus of this item. This does not affect the first submenus, but you need it here so it can be the default value for all levels. - Value: px
oCMenu.level[0].NS4font=\"tahoma,arial,helvetica\"
oCMenu.level[0].NS4fontSize=\"2\"


/*New: Added animation features that can be controlled on each level.*/
oCMenu.level[0].clip=0 //Set this to 1 if you want the submenus of this level to \"slide\" open in a animated clip effect. - Value: 0 || 1
oCMenu.level[0].clippx=0 //If you have clip spesified you can set how many pixels it will clip each timer in here to control the speed of the animation. - Value: px
oCMenu.level[0].cliptim=0 //This is the speed of the timer for the clip effect. Play with this and the clippx to get the desired speed for the clip effect (be carefull though and try and keep this value as high or possible or you can get problems with NS4). - Value: milliseconds
//Filters - This can be used to get some very nice effect like fade, slide, stars and so on. EXPLORER5.5+ ONLY - If you set this to a value it will override the clip on the supported browsers
oCMenu.level[0].filter=0 //VALUE: 0 || \"filter specs\"

oCMenu.level[0].slide=1

/*And last but not least the align variable.

This spesifies how the submenus of this level comes out.
Values:
\"bottom\": The sub menus of this level will come out on the top of this item
\"top\": The sub menus of this level will come out on the bottom of this item
\"left\": The sub menus of this level will come out on the right of this item
\"right\": The sub menus of this level will come out on the left of this item

In generally \"left\" and \"right\" works best for menus in columns and \"top\" and \"bottom\" works best for menus in rows.
But by all means feel free to play with it.

If you have set pagecheck to 1 above this is what the pagecheck will change when reaching the bounderies of the page.
If it reaches the right boundery and it\'s aligned left it will change the align to right and so on.
*/
oCMenu.level[0].align=\"bottom\" //Value: \"top\" || \"bottom\" || \"left\" || \"right\"

//EXAMPLE SUB LEVEL[1] PROPERTIES - You have to spesify the properties you want different from LEVEL[0] - If you want all items to look the same just remove this
oCMenu.level[1]=new Array() //Add this for each new level (adding one to the number)
oCMenu.level[1].width=oCMenu.level[0].width-2
oCMenu.level[1].height=22
oCMenu.level[1].style=\"padding-top:2px; font-family:tahoma, arial,helvetica; font-size:11px; font-weight:bold\"
oCMenu.level[1].align=\"bottom\"
oCMenu.level[1].offsetX=-(oCMenu.level[0].width-2)/2+20
oCMenu.level[1].offsetY=0
oCMenu.level[1].border=0
oCMenu.level[1].bordercolor=\"#006699\"

//EXAMPLE SUB LEVEL[2] PROPERTIES - You have to spesify the properties you want different from LEVEL[1] OR LEVEL[0] - If you want all items to look the same just remove this
oCMenu.level[2]=new Array() //Add this for each new level (adding one to the number)
oCMenu.level[2].width=150
oCMenu.level[2].height=20
oCMenu.level[2].bgcoloroff=\"#009999\"
oCMenu.level[2].bgcoloron=\"#0099cc\"
oCMenu.level[2].style=\"padding:2px; font-family:tahoma,arial,helvetica; font-size:10px; font-weight:bold\"
oCMenu.level[2].align=\"bottom\"
oCMenu.level[2].offsetX=0
oCMenu.level[2].offsetY=0
oCMenu.level[2].border=1
oCMenu.level[2].bordercolor=\"#006699\"
oCMenu.level[2].NS4font=\"tahoma,arial,helvetica\"
oCMenu.level[2].NS4fontSize=\"1\"

/*Variables for each menu item: (** means that they have to be spesified!)
name: The name of the item. This must be unique for each item. Do not use spaces or strange charachters in this one! **
parent: The name of the menuitem you want this to \"connect\" to. This will be a submenu of the item that have the name you place in here. ** for all other then the topitems
text: The text you want in the item. ** (except if you use images)
link: The page you want this item to link to.
target: The target window or frame you want the link to go to (Default is same window if you\'re not using frames, and the mainframe if you\'re using frames)
width: The width of the element. If not spesified it will get the default width spesified above.
height: The height of the element. If not spesified it will get the default height spesified above.
img1: The \"off\" image for element if you want to use images.
img2: The image that appears onmouseover if using images.
bgcoloroff: The background color for this item. If not spesified it will get the default background color spesified above.
bgcoloron: The \"on\" background color for this item. If not spesified it will get the default \"on\" background color spesified above.
textcolor: The text color for this item. If not spesified it will get the default text color spesified above.
hovercolor: The \"on\" text color for this item. If not spesified it will get the default \"on\" text color spesified above. Netscape4 ignores this
onclick: If you want something to happen when the element is clicked (different from going to a link) spesifiy it here.
onmouseover: This will happen when you mouseover the element. Could be status text, another imageswap or whatever.
onmouseout: This will happen when you mouseout the element.

Remember you can have as many levels/sublevels as you want. Just make sure you spesify the correct \"parent\" for each item.
To set styles for each level see above.
*/


oCMenu.makeMenu(\'top0\',\'\',\'&nbsp;News\',\'/news/index.asp\',\'\')
    oCMenu.makeMenu(\'sub00\',\'top0\',\'&nbsp;&nbsp;Newest news\',\'/news/index.asp\')
        oCMenu.makeMenu(\'sub001\',\'sub00\',\'- New DHTML API released\',\'\',\'\',160,0)
        oCMenu.makeMenu(\'sub002\',\'sub00\',\'- Explorer 7 is out\',\'\',\'\',160,0)
        oCMenu.makeMenu(\'sub003\',\'sub00\',\'- Opera 6 supports innerHTML\',\'\',\'\',160,0)
    oCMenu.makeMenu(\'sub01\',\'top0\',\'&nbsp;&nbsp;News archive\',\'/news/archive.asp\')
    oCMenu.makeMenu(\'sub02\',\'top0\',\'\',\'\',\'\',0,12,\"../images/rounded.gif\",\'\',\'Navy\',\'Navy\')
   
oCMenu.makeMenu(\'top1\',\'\',\'&nbsp;Scripts\',\'/scripts/index.asp\')
    oCMenu.makeMenu(\'sub10\',\'top1\',\'New scripts\',\'/scripts/index.asp?show=new\')
    oCMenu.makeMenu(\'sub11\',\'top1\',\'All scripts\',\'/scripts/index.asp?show=all\')
    oCMenu.makeMenu(\'sub12\',\'top1\',\'Popular scripts\',\'/scripts/index.asp?show=pop\')
    oCMenu.makeMenu(\'sub13\',\'top1\',\'\',\'\',\'\',0,12,\"../images/rounded.gif\",\'\',\'Navy\',\'Navy\')
   
oCMenu.makeMenu(\'top2\',\'\',\'&nbsp;Articles\',\'/articles/index.asp\')
    oCMenu.makeMenu(\'sub21\',\'top2\',\'Tutorials\',\'/tutorials/index.asp\')
        oCMenu.makeMenu(\'sub210\',\'sub21\',\'New tutorials\',\'/tutorials/index.asp\')
        oCMenu.makeMenu(\'sub211\',\'sub21\',\'Tutorials archive\',\'/tutorials/archive.asp\')
    oCMenu.makeMenu(\'sub22\',\'top2\',\'Other articles\',\'/articles/index.asp\')
        oCMenu.makeMenu(\'sub220\',\'sub22\',\'New articles\',\'/articles/index.asp?show=new\')
        oCMenu.makeMenu(\'sub221\',\'sub22\',\'Article archive\',\'/articles/archive.asp\')
    oCMenu.makeMenu(\'sub23\',\'top2\',\'\',\'\',\'\',0,12,\"../images/rounded.gif\",\'\',\'Navy\',\'Navy\')

oCMenu.makeMenu(\'top3\',\'\',\'&nbsp;Forums\',\'/forums/\')
    oCMenu.makeMenu(\'sub30\',\'top3\',\'General\',\'/forums/forum.asp?FORUM_ID=6&CAT_ID=1&Forum_Title=General+DHTML+issues\')
    oCMenu.makeMenu(\'sub31\',\'top3\',\'Scripts\',\'/forums/forum.asp?FORUM_ID=4&CAT_ID=1&Forum_Title=DHTML+Scripts\')
    oCMenu.makeMenu(\'sub32\',\'top3\',\'Crossbrowser\',\'/forums/forum.asp?FORUM_ID=3&CAT_ID=1&Forum_Title=Crossbrowser+DHTML\')
    oCMenu.makeMenu(\'sub33\',\'top3\',\'CoolMenus\',\'/forums/forum.asp?FORUM_ID=2&CAT_ID=1&Forum_Title=CoolMenus\')
    oCMenu.makeMenu(\'sub34\',\'top3\',\'dhtmlcentral.com\',\'/forums/forum.asp?FORUM_ID=5&CAT_ID=1&Forum_Title=dhtmlcentral%2Ecom\')
    oCMenu.makeMenu(\'sub35\',\'top3\',\'Cool sites\',\'/forums/forum.asp?FORUM_ID=1&CAT_ID=1&Forum_Title=Cool+sites\')
    oCMenu.makeMenu(\'sub36\',\'top3\',\'\',\'\',\'\',0,12,\"../images/rounded.gif\",\'\',\'Navy\',\'Navy\')

oCMenu.makeMenu(\'top5\',\'\',\'&nbsp;CoolMenus\',\'/coolmenus/index.asp\')
    oCMenu.makeMenu(\'sub50\',\'top5\',\'Examples\',\'/coolmenus/examples.asp\')
        oCMenu.makeMenu(\'sub500\',\'sub50\',\'With frames\',\'/coolmenus/examples.asp?show=with\')
        oCMenu.makeMenu(\'sub501\',\'sub50\',\'Without frames\',\'/coolmenus/examples.asp?show=without\')
    oCMenu.makeMenu(\'sub51\',\'top5\',\'Download\',\'/coolmenus/download.asp\')
        oCMenu.makeMenu(\'sub510\',\'sub51\',\'Download the source code to this menu\',\'/coolmenus/download.asp\',\'\',150,40)
    oCMenu.makeMenu(\'sub52\',\'top5\',\'Tutorial\',\'/coolmenus/tutorial.asp\')
        oCMenu.makeMenu(\'sub520\',\'sub52\',\'Learn how to set up the menu\',\'/coolmenus/tutorial.asp\',\'\',150,40)
    oCMenu.makeMenu(\'sub53\',\'top5\',\'MenuMaker\',\'\',\'\',0,0,\'\',\'\',\'\',\'\',\'\',\'\',\'window.open(\"/coolmenus/maker/\",\"\",\"width=800,height=600\")\')
        oCMenu.makeMenu(\'sub530\',\'sub53\',\'Use the menuMaker to make the menu code for you\',\'\',\'\',150,40,\'\',\'\',\'\',\'\',\'\',\'\',\'window.open(\"/coolmenus/maker/\",\"\",\"width=800,height=600\")\')
    oCMenu.makeMenu(\'sub54\',\'top5\',\'FAQ\',\'/coolmenus/faq.asp\')
        oCMenu.makeMenu(\'sub540\',\'sub54\',\'Frequently asked questions\',\'coolmenus/faq.asp\',\'\',150,40)
    oCMenu.makeMenu(\'sub55\',\'top5\',\'Help forum\',\'/forums/forum.asp?FORUM_ID=2&CAT_ID=1&Forum_Title=CoolMenus\')
        oCMenu.makeMenu(\'sub550\',\'sub55\',\'Go to this forum and post you problems or suggestions regarding the CoolMenus\',\'/forum/forum.asp?forum_id=2\',\'\',150,40)
    oCMenu.makeMenu(\'sub56\',\'top5\',\'\',\'\',\'\',0,12,\"../images/rounded.gif\",\'\',\'Navy\',\'Navy\')
       
oCMenu.makeMenu(\'top6\',\'\',\'&nbsp;Test Links\',\'\')
    oCMenu.makeMenu(\'sub060\',\'top6\',\'sub1/test1.html\',\'sub1/test1.html\')
        oCMenu.makeMenu(\'sub0600\',\'sub060\',\'sub1/subsub1/test1.html\',\'sub1/subsub1/test1.html\')
        oCMenu.makeMenu(\'sub0601\',\'sub060\',\'sub1/subsub1/test2.html\',\'sub1/subsub1/test2.html\')
        oCMenu.makeMenu(\'sub0602\',\'sub060\',\'sub1/subsub1/test3.html\',\'sub1/subsub1/test3.html\')
    oCMenu.makeMenu(\'sub061\',\'top6\',\'sub1/test2.html\',\'sub1/test2.html\')
    oCMenu.makeMenu(\'sub062\',\'top6\',\'sub1/test3.html\',\'sub1/test3.html\')
    oCMenu.makeMenu(\'sub063\',\'top6\',\'sub2/test1.html\',\'sub2/test1.html\')
    oCMenu.makeMenu(\'sub064\',\'top6\',\'sub2/test2.html\',\'sub2/test2.html\')
    oCMenu.makeMenu(\'sub065\',\'top6\',\'sub2/test3.html\',\'sub2/test3.html\')
    oCMenu.makeMenu(\'sub066\',\'top6\',\'\',\'\',\'\',0,12,\"../images/rounded.gif\",\'\',\'Navy\',\'Navy\')
       
       
//Leave these two lines! Making the styles and then constructing the menu
oCMenu.makeStyle(); oCMenu.construct()           
</script>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>

</body>
</html>
Avatar billede Slettet bruger
20. august 2001 - 21:21 #4
Avatar billede Slettet bruger
20. august 2001 - 21:37 #5
Eller rettere:
http://www.dynamicdrive.com/dynamicindex1/index.html
Der er endeløst mange menuer, og de er betydeligt hurtigere at loade end DHTML-Central\'s!
Avatar billede spiri Nybegynder
21. august 2001 - 00:17 #6
Endelig er der jo denne her:

<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.0 Transitional//EN\">
<html>
<!-- 2001-07-20 22:10:01 -->
<head>
<title>TV 2</title>
<meta http-equiv=\"Content-Type\" content=\"text/html; charset=ISO-8859-1\">
<meta http-equiv=\"Expires\" content=\"Fri, 20 Jul 2001 20:15:01 GMT\">
<style type=\"text/css\">
a:link,a:active,a:visited{color:#333333}
a.overs1:link,a.overs2:link,a.overs3:link,a.overs4:link,a.overs5:link,a.overs6:link,a.overs7:link,a.overs:link,
a.overs1:active,a.overs2:active,a.overs3:active,a.overs4:active,a.overs5:active,a.overs6:active,a.overs7:active,a.overs:active,
a.overs1:visited,a.overs2:visited,a.overs3:visited,a.overs4:visited,a.overs5:visited,a.overs6:visited,a.overs7:visited,a.overs:visited{text-decoration:none;color:#999999}
a.overs1:hover{background:#990000;color:white}
a.overs2:hover{background:#CC6600;color:white}
a.overs3:hover{background:#CC9900;color:white}
a.overs4:hover{background:#66AA66;color:white}
a.overs5:hover{background:#009966;color:white}
a.overs6:hover{background:#336699;color:white}
a.overs7:hover{background:#003399;color:white}
a.overs:hover{background:#999999;color:white}
</style>
<link rel=stylesheet title=std href=\"tv2style.css\" type=\"text/css\">
<style type=\"text/css\">
body,td.bund,td.bund-side,td.bund-linie-side,td.bund-linie{background:#666666}
td{font-family:verdana;font-size:10px;vertical-align:top;color:#333333}

.marg1,.topfelt1{padding:0px 7px}
.marg,.topfelt{padding:0px 9px}
.topfelt1,.topfelt{height:120px;text-align:center}
.marg1234{padding:0px 9px 0px 7px}
.topspalte,.topspalte1,.spalte23{background:white}
.spalte1,.spalte4,.spalte1234,.bannerspalte,td.banner-bg{background:white}

.box{background:#cccccc}

.felthead{font-family:arial;font-size:18px;color:#999999}
.firstletter{background:#990000;color:white}

.hand{cursor:pointer}
img.topimg{border-style:solid;border-color:black;border-width:2px}
.annimg{border-style:solid;border-color:black;border-width:1px}

.overskrift{font-size:1.2em;font-weight:bold}
td.annlink{font-size:12px;background:#cccccc}

a.noline-dark:link,a.noline-dark:active,a.noline-dark:visited,a.noline-dark:hover{color:#333333;text-decoration:none}
a:hover,a.red:hover,a.noline-red:hover{color:#999999}
td.light,.light{color:#999999}
.boxlight{color:#666666}
form{margin:0}

input.ttv{height:18px;font-size:10px;font-family:verdana;width:30px}
select.tv{font-family:arial,helvetica;font-size:10px;width:61px}
</style>
</head>

<body marginwidth=0 marginheight=0>
<script type=\"text/javascript\" src=\"menu.js\" language=\"JavaScript\"></script>
<script type=\"text/javascript\" src=\"top.js\"></script><script type=\"text/javascript\">document.write(html);document.close()</script>
<script type=\"text/javascript\">

bannerpulje=\"forsiden\"
bannerantal=1
bannernoflick=1
bundoff=1
//pingboxPad=14

feltborder=(NS4)?\"border=2\":\"class=topimg\"
annborder=(NS4)?\"border=1\":\"class=annimg\"
</script>
<div align=center>
<noscript>
Menu:
<a href=\"/nyheder/\">nyheder</a>
<a href=\"/tv/\">tv</a>
<a href=\"/magasin/\">magasin</a>
<a href=\"/marked/\">marked</a>
<a href=\"/spil/\">spil</a>
<a href=\"/ping/\">ping</a>
<br>
  <a href=\"/indeks/\">sitemap</a> </noscript> </div>
</body>
</html>




Husk også
http://inc.tv2.dk/top/menu.js
http://inc.tv2.dk/top/top.js

Jeg går ud fra at du godt må ta\' den, det står der da i kildekoden.


Avatar billede warpgiga Nybegynder
21. august 2001 - 11:20 #7
Hmm... ikke at det ikke er ok, men er det ikke bare lidt overkill at stille et sådant spørgsmål, jeg synes du er heldig nogen faktisk gider sende dig en hel \"TV2-menu\" ;)

Jeg vil ihvertfald ikke spilde min tid på at lave en 100% perfekt menu i en fart.. Og i og med at du ikke selv kan finde ud af noget som helst JavaScript, vil jeg da også have penge at lave det, da jeg ser dette forum som et programmør forum, og ikke et bestillings site til (gratis) færdige løsninger.. well bare min mening, ingen grund til vild spam ;) he he
Avatar billede redhead Nybegynder
21. august 2001 - 17:33 #8
warpgiga >> Det med 100% kunne godt misforstås. Det er bare fordi jeg ahvde brugt flere timer på at lede Nettet igennem efter en menu. For det andet tror jeg at du har misforstået meningen med eksperten.dk. Man hjælper andre imod point, og ikke penge.
Avatar billede warpgiga Nybegynder
22. august 2001 - 01:20 #9
redhead >> ok ok, jeg har også været desperat til tider.. Nej, jeg har ikke misforstået meningen, og ville aldrig forsøge at tjene penge igennem eksperten, men det virkede umiddelbart som om du bestilte et produkt, og ikke spurgte om hjælp.. men jeg har som du siger nok misforstået din mening.. vi ses på eksperten ;)
Avatar billede redhead Nybegynder
26. august 2001 - 22:10 #10
warpgiga >> No problem :o)

Btw... så lukker jeg spørgsmålet... ingen af svarene virker, og jeg skal ikke bruge menuen aligevel...
Avatar billede spiri Nybegynder
26. august 2001 - 22:19 #11
Hvad mener du med at ingen af svarerne virker???
Avatar billede redhead Nybegynder
27. august 2001 - 20:55 #12
De eneste der virker er dem på dynamicdrive... og ingen af dem kan an selv besteme hvor skal sidde...
Avatar billede Ny bruger Nybegynder

Din løsning...

Tilladte BB-code-tags: [b]fed[/b] [i]kursiv[/i] [u]understreget[/u] Web- og emailadresser omdannes automatisk til links. Der sættes "nofollow" på alle links.

Loading billede Opret Preview
Kategori
Vi tilbyder markedets bedste kurser inden for webudvikling

Log ind eller opret profil

Hov!

For at kunne deltage på Computerworld Eksperten skal du være logget ind.

Det er heldigvis nemt at oprette en bruger: Det tager to minutter og du kan vælge at bruge enten e-mail, Facebook eller Google som login.

Du kan også logge ind via nedenstående tjenester