maddy007
asked on
onmouseover javascript for a submenu
Why is my onmouseover javascript for a submenu not working?
1cell gave me a script for my needs. I got it to work, but then I started putting in most of my info, links, font color,etc. I added another javascipt to the page and it still worked so that must not be it. I think when I was typing in my info it messed something up and I just can't see it. Will someone be willing to take a look at it and see if you can see why it won't work. 1cell?
<HTML>
<!--This file created 1:58 AM 8/19/01 by Claris Home Page version 3.0-->
<HEAD>
<TITLE>default4</TITLE>
<META NAME=GENERATOR CONTENT="Claris Home Page 3.0">
<X-CLARIS-WINDOW TOP=21 BOTTOM=443 LEFT=21 RIGHT=718>
<X-CLARIS-REMOTESAVE SERVER="209.96.106.4" USER="Sharon Godiska" DIR="/ehwebserver/Web Folder/" FILE="">
<X-CLARIS-TAGVIEW MODE=minimal>
<script><!--
var content=new Array()
/*change the array below to the links associated with menu links Expand or contract the array, depending
on how many menus you have*/
content[0]='<b>Administrat ion</b><br ><a href="admin.html">A Message from Mr. Kressly, our Principal.</a>'
content[1]='<b>Current Events</b><br><a href="chupdate.html">Charg er Update</a><br><a href="calendar.html">Distr ict Calendar</a><br><a href="jkressly.html">EHMS Calendar</a>'
content[2]='<b>HW and Team Info.</b><br><a href="team_info/team6G.htm l">Team 6G</a><br><a href="team_info/team6H.htm l">Team 6H</a><br><a href="team_info/team6L.htm l">Team 6L</a><br><a href="team_info/team6P.htm l">Team 6P</a><br><a href="team_info/team6T.htm l">Team 6T</a><br><a href="team_info/team6Z.htm l">Team 6Z</a><br><a href="team_info/team7H.htm l">Team 7H</a><br><a href="team_info/team7M.htm l">Team 7M</a><br><a href="team_info/team7NQ.ht ml">Team 7NQ</a><br><a href="team_info/team7R.htm l">Team 7R</a><br><a href="team_info/team8D.htm l">Team 8D</a><br><a href="team_info/team8J.htm l">Team 8J</a><br><a href="team_info/team8M.htm l">Team 8M</a><br><a href="team_info/team8P.htm l">Team 8P</a><br><a href="team_info/EAP_ESOL.h tml">EAP/E SOL</a><a href="team_info/related_ar ts.html">R elated Arts</a><br><a href="team_info/seminar.ht ml">Semina r</a><br>< a href="team_info/spec_ed.ht ml">Specia l Education</a>'
content[3]='<b>Organizatio ns</b><br> <a href="band.html">Band and Orchestra Organization</a><br><a href="EHPA/EHPA_main.htm"> Parent Association</a>'
content[4]='<b>Resources</ b><br><a href="links.html">Curricul um Resources</a><br><a href="link2.html">Faculty/ Staff</a>< br><a href="link3.html">Library< /a><br><a href="phone.html">Phone Numbers</a><br><a href="link5.html">The Standards</a>'
content[5]='<b>Special Programs</b><br><a href="harmonium.html">Harm onium</a>< br><a href="link2.html">Monagacc i</a><br>< a href="link3.html">Nature Quest</a><br><a href="spiritbeth.html">Spi rit of Bethlehem</a>'
content[6]='<b>Student Services</b><br><a href="activities.html">Act ivities</a ><br><a href="guidance.html">Guida nce</a><br ><a href="sports.html">Intersc holastic sports</a><br><a href="intramurals.html">In tramurals< /a>'
content[7]='<b>Site Map</b><br><a href="sitemap.html">If you don't see what you are looking for click here for our site map.</a>'
function recreate(){
window.location.reload()
}
function recreate2(){
if (document.layers){
appear()
setTimeout("window.onresiz e=recreate ",450)
}
}
function changeMenu(whichMenu){
if (document.all||document.ge tElementBy Id){
cross_el=document.getEleme ntById? document.getElementById("d escription s"):docume nt.all.des criptions
cross_el.innerHTML=whichMe nu
}
else if (document.layers){
document.first.document.se cond.docum ent.write( '<font face="Verdana">'+whichMenu +'</font>' )
document.first.document.se cond.docum ent.close( )
}
}
function appear(){
document.first.visibility= 'show'
}
window.onload=recreate2
//--></script>
</HEAD>
<BODY BGCOLOR="#FFFFFF" LINK="#800000" VLINK="#808080" BACKGROUND="images/ehbkgrd .gif">
<P><TABLE BORDER=0 WIDTH=610>
<TR>
<TD WIDTH=30>
<P></P>
</TD>
<TD VALIGN=top WIDTH=566>
<P><IMG SRC="images/ehmstitle2.jpg " WIDTH=550 HEIGHT=144 X-CLARIS-USEIMAGEWIDTH X-CLARIS-USEIMAGEHEIGHT ALIGN=bottom></P>
</TD>
</TR>
<TR>
<TD WIDTH=30>
<P></P>
</TD>
<TD WIDTH=566>
<P></P>
</TD>
</TR>
</TABLE>
<TABLE BORDER=0 WIDTH=610>
<TR>
<TD WIDTH=30>
<P></P>
</TD>
<TD WIDTH=135>
<CENTER> </CENTER>
<P><div id="scriptmenu" style="line-height:20px"> <A HREF="#" onmouseover="changeMenu(co ntent[0])" ><FONT COLOR="#660033">Administra tion</FONT ></A><FONT COLOR="#660033"><BR>
</FONT> <A HREF="#" onmouseover="changeMenu(co ntent[1])" ><FONT COLOR="#660033">Current
Events</FONT></A> <FONT COLOR="#660033"><BR>
</FONT> <A HREF="#" onmouseover="changeMenu(co ntent[2])" ><FONT COLOR="#660033">HW
& Team Info.</FONT></A> <FONT COLOR="#660033"><BR>
</FONT> <A HREF="#" onmouseover="changeMenu(co ntent[3])" ><FONT COLOR="#660033">
Organizations</FONT></A><F ONT COLOR="#660033"><BR>
</FONT> <A HREF="#" onmouseover="changeMenu(co ntent[4])" ><FONT COLOR="#660033">Resources< /FONT></A> <FONT COLOR="#660033"><BR>
</FONT> <A HREF="#" onmouseover="changeMenu(co ntent[5])" ><FONT COLOR="#660033">Special
Programs</FONT></A><FONT COLOR="#660033"><BR>
</FONT> <A HREF="#" onmouseover="changeMenu(co ntent[6])" ><FONT COLOR="#660033">Student
Services</FONT></A><FONT COLOR="#660033"><BR>
</FONT> <A HREF="#" onmouseover="changeMenu(co ntent[7])" ><FONT COLOR="#660033">Site
Map</FONT></A><FONT COLOR="#660033"><BR>
</FONT></div></P>
</TD>
<TD WIDTH=151>
<CENTER><TABLE BORDER=0>
<TR>
<TD BACKGROUND="images/initial s2.gif" HEIGHT=275>
<P> </P>
<CENTER><ilayer id="first" width="200" height="200" visibility="hide">
<layer id="second" width="200" height="200"> <div id="descriptions" align="left">
<!--Change below to default menu--></CENTER>
<H2><CENTER><FONT COLOR="#800000">An Experience in
Excellence</FONT></CENTER> </H2>
<CENTER><!--Stop editting--> </div> </layer> </ilayer></CENTER>
</TD>
</TR>
</TABLE>
</CENTER>
</TD>
<TD WIDTH=325>
<P><SCRIPT LANGUAGE=JavaScript><!--
/*
Script by FPMC at http://jsarchive.8m.com
Submitted to Website Abstraction (http://wsabstract.com)
For this and 400+ free scripts, visit http://wsabstract.com
*/
//set image paths
src = ["images/1.jpg", "images/2.jpg", "images/3.jpg", "images/4.jpg"]
//set corresponding urls
url = ["http://freewarejava.com", "http://wsabstract.com", "http://dynamicdrive.com", "http://www.geocities.com"]
//set duration for each image
duration = 4;
//Please do not edit below
ads=[]; ct=0;
function switchAd() {
var n=(ct+1)%src.length;
if (ads[n] && (ads[n].complete || ads[n].complete==null)) {
document["Ad_Image"].src = ads[ct=n].src;
}
ads[n=(ct+1)%src.length] = new Image;
ads[n].src = src[n];
setTimeout("switchAd()",du ration*100 0);
}
function doLink(){
location.href = url[ct];
} onload = function(){
if (document.images)
switchAd();
}
//--></SCRIPT> <A HREF="javascript:doLink(); " onmouseover="status=url[ct ];return true;" onmouseout="status=''">
<IMG SRC="images/1.jpg" WIDTH=253 HEIGHT=253 X-CLARIS-USEIMAGEWIDTH X-CLARIS-USEIMAGEHEIGHT BORDER=0 ALIGN=bottom name="Ad_Image">
</A></P>
<CENTER><FONT SIZE="-2" FACE="arial">This free script
provided by </FONT><A HREF="http://wsabstract.com"><FONT SIZE="-2" FACE="arial">Website
Abstraction</FONT></A></CE NTER>
</TD>
</TR>
<TR>
<TD WIDTH=30>
<P></P>
</TD>
<TD WIDTH=135>
<P></P>
</TD>
<TD WIDTH=151>
<P></P>
</TD>
<TD WIDTH=325>
<P></P>
</TD>
</TR>
</TABLE>
</P>
</BODY>
</HTML>
1cell gave me a script for my needs. I got it to work, but then I started putting in most of my info, links, font color,etc. I added another javascipt to the page and it still worked so that must not be it. I think when I was typing in my info it messed something up and I just can't see it. Will someone be willing to take a look at it and see if you can see why it won't work. 1cell?
<HTML>
<!--This file created 1:58 AM 8/19/01 by Claris Home Page version 3.0-->
<HEAD>
<TITLE>default4</TITLE>
<META NAME=GENERATOR CONTENT="Claris Home Page 3.0">
<X-CLARIS-WINDOW TOP=21 BOTTOM=443 LEFT=21 RIGHT=718>
<X-CLARIS-REMOTESAVE SERVER="209.96.106.4" USER="Sharon Godiska" DIR="/ehwebserver/Web Folder/" FILE="">
<X-CLARIS-TAGVIEW MODE=minimal>
<script><!--
var content=new Array()
/*change the array below to the links associated with menu links Expand or contract the array, depending
on how many menus you have*/
content[0]='<b>Administrat
content[1]='<b>Current Events</b><br><a href="chupdate.html">Charg
content[2]='<b>HW and Team Info.</b><br><a href="team_info/team6G.htm
content[3]='<b>Organizatio
content[4]='<b>Resources</
content[5]='<b>Special Programs</b><br><a href="harmonium.html">Harm
content[6]='<b>Student Services</b><br><a href="activities.html">Act
content[7]='<b>Site Map</b><br><a href="sitemap.html">If you don't see what you are looking for click here for our site map.</a>'
function recreate(){
window.location.reload()
}
function recreate2(){
if (document.layers){
appear()
setTimeout("window.onresiz
}
}
function changeMenu(whichMenu){
if (document.all||document.ge
cross_el=document.getEleme
cross_el.innerHTML=whichMe
}
else if (document.layers){
document.first.document.se
document.first.document.se
}
}
function appear(){
document.first.visibility=
}
window.onload=recreate2
//--></script>
</HEAD>
<BODY BGCOLOR="#FFFFFF" LINK="#800000" VLINK="#808080" BACKGROUND="images/ehbkgrd
<P><TABLE BORDER=0 WIDTH=610>
<TR>
<TD WIDTH=30>
<P></P>
</TD>
<TD VALIGN=top WIDTH=566>
<P><IMG SRC="images/ehmstitle2.jpg
</TD>
</TR>
<TR>
<TD WIDTH=30>
<P></P>
</TD>
<TD WIDTH=566>
<P></P>
</TD>
</TR>
</TABLE>
<TABLE BORDER=0 WIDTH=610>
<TR>
<TD WIDTH=30>
<P></P>
</TD>
<TD WIDTH=135>
<CENTER> </CENTER>
<P><div id="scriptmenu" style="line-height:20px"> <A HREF="#" onmouseover="changeMenu(co
</FONT> <A HREF="#" onmouseover="changeMenu(co
Events</FONT></A> <FONT COLOR="#660033"><BR>
</FONT> <A HREF="#" onmouseover="changeMenu(co
& Team Info.</FONT></A> <FONT COLOR="#660033"><BR>
</FONT> <A HREF="#" onmouseover="changeMenu(co
Organizations</FONT></A><F
</FONT> <A HREF="#" onmouseover="changeMenu(co
</FONT> <A HREF="#" onmouseover="changeMenu(co
Programs</FONT></A><FONT COLOR="#660033"><BR>
</FONT> <A HREF="#" onmouseover="changeMenu(co
Services</FONT></A><FONT COLOR="#660033"><BR>
</FONT> <A HREF="#" onmouseover="changeMenu(co
Map</FONT></A><FONT COLOR="#660033"><BR>
</FONT></div></P>
</TD>
<TD WIDTH=151>
<CENTER><TABLE BORDER=0>
<TR>
<TD BACKGROUND="images/initial
<P> </P>
<CENTER><ilayer id="first" width="200" height="200" visibility="hide">
<layer id="second" width="200" height="200"> <div id="descriptions" align="left">
<!--Change below to default menu--></CENTER>
<H2><CENTER><FONT COLOR="#800000">An Experience in
Excellence</FONT></CENTER>
<CENTER><!--Stop editting--> </div> </layer> </ilayer></CENTER>
</TD>
</TR>
</TABLE>
</CENTER>
</TD>
<TD WIDTH=325>
<P><SCRIPT LANGUAGE=JavaScript><!--
/*
Script by FPMC at http://jsarchive.8m.com
Submitted to Website Abstraction (http://wsabstract.com)
For this and 400+ free scripts, visit http://wsabstract.com
*/
//set image paths
src = ["images/1.jpg", "images/2.jpg", "images/3.jpg", "images/4.jpg"]
//set corresponding urls
url = ["http://freewarejava.com", "http://wsabstract.com", "http://dynamicdrive.com", "http://www.geocities.com"]
//set duration for each image
duration = 4;
//Please do not edit below
ads=[]; ct=0;
function switchAd() {
var n=(ct+1)%src.length;
if (ads[n] && (ads[n].complete || ads[n].complete==null)) {
document["Ad_Image"].src = ads[ct=n].src;
}
ads[n=(ct+1)%src.length] = new Image;
ads[n].src = src[n];
setTimeout("switchAd()",du
}
function doLink(){
location.href = url[ct];
} onload = function(){
if (document.images)
switchAd();
}
//--></SCRIPT> <A HREF="javascript:doLink();
<IMG SRC="images/1.jpg" WIDTH=253 HEIGHT=253 X-CLARIS-USEIMAGEWIDTH X-CLARIS-USEIMAGEHEIGHT BORDER=0 ALIGN=bottom name="Ad_Image">
</A></P>
<CENTER><FONT SIZE="-2" FACE="arial">This free script
provided by </FONT><A HREF="http://wsabstract.com"><FONT SIZE="-2" FACE="arial">Website
Abstraction</FONT></A></CE
</TD>
</TR>
<TR>
<TD WIDTH=30>
<P></P>
</TD>
<TD WIDTH=135>
<P></P>
</TD>
<TD WIDTH=151>
<P></P>
</TD>
<TD WIDTH=325>
<P></P>
</TD>
</TR>
</TABLE>
</P>
</BODY>
</HTML>
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thank you both of you. I can't believe I didn't notice that myself. I should have. I have been using html for about 3 years now and teach my students it,too. We know that one quote left out of an a href will destroy the link. Anyway, thank you. thank you. thank you.
content[7]='<b>Site Map</b><br><a href="sitemap.html">If you don\'t see what you are looking for click here for our site map.</a>'
if you don't escape you are cutting the string and that causes the error
ciao
Y