Milonic provide full featured pull down web menus for some of the worlds largest companies
click here to see what it can do for you

Download Milonic DHTML Menu
Buy Milonic DHTML Menu

Back To Start Of Archive
Taken From The Forum: Archived Topics for the old Version 3.0 JavaScript Menu
Forum Topic: Click to view post
Last Updated: Saturday July 14 2012 - 06:07:27

body Onload event not firing


Poster: john_pan
Dated: Friday June 20 2003 - 21:00:18 BST

I also am having a problem with the onload event in the body tag not firing, I have read and tried what was proposed to others with the same problem, with no luck. here is a sample of code:
+++++++++++++++++++++++++++++++++++++++++++++++
<html>
<head>


<style type="text/css">
<!--
.small {
color : #ffffff;

font:10px Verdana,sans-serif
}
.theselects {background-color:#FF; color:#996633;font-family:Verdana;font-weight:bold;font-size:7pt;}
.theselects2 {background-color:#FFFFFF; color:#996633;font-family:Verdana;font-weight:bold;font-size:7pt;}
.sbttn {background: #FFCACA;border-bottom: 1px solid #FF0000;border-right: 1px solid #FF0000;border-left: 1px solid #AFC4D5;border-top:1px solid #AFC4D5;color:#840000;height:19px;text-decoration:none;cursor: hand}
A:link.menu2 { color: #840000 }
A:visited.menu2 {color: #840000 }
A:active.menu2 {color: #840000 }
A:hover.menu2 { color: #FFCACA }
.menu2 { font-size:14pt; text-decoration:none;}
-->
</style>
</head>
<body bgcolor="#ffffff" onload='alert("here");' style="right-margin:0px;left-margin:0px;">
<script language="JavaScript">
var isNav, isIE;
var coll = "";
var styleObj = "";
if( parseInt(navigator.appVersion) >= 4 ) {if( navigator.appName == "Netscape" )
{isNav = true;;coll = "layers.";styleObj = ".style";}
else {isIE = true;coll = "all.";styleObj = ".style";}
}

var ns = isNav;
var ie = isIE;
var cc = 0;
function getObject(obj) {var theObj;
if( typeof obj == "string" )
{theObj = eval("document." + coll + obj + styleObj);}
else {theObj = obj;}return theObj;}

function doIt(theobj)
{

var thedisplay = getObject(theobj);
if (isIE)
{
if (thedisplay.visibility == "hidden")
{
thedisplay.visibility = "visible";
}
else
{
thedisplay.visibility = "hidden";
}
}
else
{
var theval = eval("document.layers['" + theobj +"'].visibility");
if (theval == "hide")
{
eval("document.layers['" + theobj +"'].visibility = 'show'");
}
else
{
eval("document.layers['" + theobj +"'].visibility = 'hide'");
}
}



}

</script>
<SCRIPT language=JavaScript>
/*
* DHTML Menu version 3.3
* written by Andy Woolley
* Copyright 2002 Andy Woolley. All Rights Reserved.
*/
</SCRIPT>

<SCRIPT language=JavaScript src="menu_array.js" type=text/javascript></SCRIPT>
<SCRIPT language=JavaScript src="mmenu.js" type=text/javascript></SCRIPT>

<style type="text/css">
<!--

.over
{ background-color:yellow;
border-style: double;
border-color: red;
border-width:wide;
color:#840000;
font-family: Verdana,sans-serif;
font-size:8pt;
font-weight:BOLD;
cursor: hand
}

.out
{ background-color:#FFCACA;
border-style: groove;
border-color: red;
border-width:thin;
color:#840000;
font-family: Verdana,sans-serif;
font-size:8pt;
font-weight:BOLD;
}
A.menu:link { color: white}
A.menu:visited {color: white}
A.menu:active {color: white}
A.menu:hover { color: yellow }

.menu { font-size:8pt; font-weight:bold; text-decoration:none; }
-->
</style>
<div style="position:absolute;background-color:#840000; width:100%; height:100px; left: 0px; top: 0px;" >
<img src="../saratgostats.gif" height=102 width=100 align='left'>
</div>


<div id="header" style="color:#ffffff;font-size:14pt;background-color:#840000;position: absolute; width: 300px; height:20px; left: 102px; top:10px;z-index:2; " >Saratoga Stats Center</div>



<div id="selection" style="background-color:#ffffff;border-style:none; position: absolute; left: 0px; top:108px;z-index:2; " >
Select from one of the following items:</div>


<div id="menus" style="background-color:#ffffff;border-style:none; position: absolute; left: 30px; top:130px;z-index:2; " >
<a href="statselect.cfm" class="menu2">Superstats</a><p>
<a href="profileselect.cfm" class="menu2">Profiles</a><p>
<a href="raceselect.cfm" class="menu2">Races</a><p>
<a href="pps.cfm" class="menu2">Post Positions</a>
</div>

</body>
</html>
+++++++++++++++++++++++++++++++++++++++++++++

Thanks in advance,

John