I need help with cross browser problems with my church website. I =
created a new menu system using Dynapi objects and it works fine with =
Microsoft Explorer but doesn't work with any version of Netscape or AOL =
that I have been able to try. My demo site is http://sunriseumc.com/demo =
(note the links don't actually work on the demo). =20
I would appreciate any ideas as to where my problem is and how to fix =
it. Or is there a better way to create dynamic menus?
A sample of the dynamically created code (from an ASP database query) =
used to generate the menu is as follows:
<script language=3D"Javascript" src=3D"dynapi.js"></script>
<script language=3D"Javascript">
DynAPI.setLibraryPath('/lib/');
DynAPI.include('dynapi.api.*');
DynAPI.include('dynapi.api.browser.js')
DynAPI.include('dynapi.api.dynlayer.js')
DynAPI.include('dynapi.api.dyndocument.js')
DynAPI.include('dynapi.event.*')
DynAPI.onLoad =3D function() {
menu0 =3D new DynLayer(null, 5 ,100 ,75 ,0, '');
menu0.setVisible(true)
DynAPI.document.addChild(menu0)
menu0_0 =3D new DynLayer(null,0, 0, 75, 25,'');
menu0_0.setHTML('<table CLASS=3D"menuStyle" WIDTH=3D"75" =
CELLSPACING=3D1 BORDER=3D0><TR><TD =
ALIGN=3D"right"><B>Home</B></TD></TR></TABLE>')
menuListener0 =3D new EventListener(menu0_0)
menuListener0.onmouseover=3Dfunction(e){target=3De.getTarget();target.set=
BgColor('FFFF66'); displaySubMenu(0,1)}
menuListener0.onmouseout=3Dfunction(e){target=3De.getTarget();target.setB=
gColor('');}
menu0_0.addEventListener(menuListener0)
menu1 =3D new DynLayer(null,80, 100, 75,0, '');
menu1.setVisible(false)
DynAPI.document.addChild(menu1)
menu0_0.setVisible(true)
menu0.addChild(menu0_0)
menu1_0 =3D new DynLayer(null,0, 0, 75, 25,'');
menu1_0.setHTML('<FORM NAME=3D"menuForm1_0" action=3D"default.asp" =
method=3D"POST"><input type=3Dhidden name=3D"goToPage" =
value=3D"public/t_about.asp"><table CLASS=3D"menuStyle" WIDTH=3D"75" =
CELLSPACING=3D1 BORDER=3D0><TR><TD ALIGN=3D"right"><A =
HREF=3D"javascript:document.menuForm1_.submit();"><B>About =
Us</B></A></TD></TR></TABLE></FORM>')
menuListener1 =3D new EventListener(menu1_0)
menuListener1.onmouseover=3Dfunction(e){target=3De.getTarget();target.set=
BgColor('FFFF66'); displaySubMenu(1,1)}
menuListener1.onmouseout=3Dfunction(e){target=3De.getTarget();target.setB=
gColor('');}
menu1_0.addEventListener(menuListener1)
menu1_0.setVisible(true)
menu1.addChild(menu1_0)
... 9 menus are dynamically created ...
menu0.setHeight(250)
menu1.setHeight(50)
menu2.setHeight(75)
menu3.setHeight(50)
menu4.setHeight(100)
menu5.setHeight(50)
menu6.setHeight(75)
menu7.setHeight(25)
menu8.setHeight(25)
}
=20
function displaySubMenu(menuCounter,nextMenuCounter)
{
if (menuCounter =3D=3D 0) { menuCounter =3D 1}
for (i=3D menuCounter; i <=3D 8 ; i++)
{ =20
eval("menu" + i + ".setVisible(false)")
}
eval("menu" + nextMenuCounter + ".setVisible(true)")
}
</script>
Thanks,
Brian
Webmaster for Sunrise United Methodist Church
|