Javascript Rollovers not Refreshing on Dynamic Webpages.

J

John Ortt

I am trying to write a webpage in Javascript. The page loads with three
frames, a top, left and right frame.

Depending on the users actions the background page rewrites the code for the
relevant frames.

The problem I am having is that I have four rollover states for each button.

"Unused", "Unused with mouseover", "Used", and "Used with mouseover".

The "Unused" state has a slightly lighter shadow than the "Used" state and
the mouseover actions place a fingerprint over the icon the user is about to
click.

The problem is that the images do not seem to be loading and refreshing
correctly.

A link to the page in progress can be seen below:

http://www.asgf80.dsl.pipex.com/Java/Index.html

Failing that the original code follows below.

Thankyou for taking the time to read this and any help will be greatly
appreciated.

John Ortt.



Code Follows:
\\\\\\\\\\\\\\\\\\\\\

<html>

<head>
<title>Welcome to John Ortt's Homepage</title>
<html>

<head>
<meta http-equiv="content-type" content="text/html;charset=iso-8859-1">
<title>Welcome to John Ortt's Internet Site</title>

<SCRIPT language=javascript type=text/javascript>
<!-- Hide Me

if (top.location != self.location) {top.location = self.location}

if (document.images)

{

up = new Array("Up.gif","UpF.gif","UpP.gif","UpFP.gif");
aboutMe = new
Array("AboutMe.gif","AboutMeF.gif","AboutMeP.gif","AboutMeFP.gif");
myCv = new Array("MyCV.gif","MyCVF.gif","MyCVP.gif","MyCVFP.gif");
javaScript = new
Array("Javascript.gif","JavascriptF.gif","JavascriptP.gif","JavascriptFP.gif
");
projects = new
Array("Projects.gif","ProjectsF.gif","ProjectsP.gif","ProjectsFP.gif");

var up_1=0
var up_2=0
var about_me=0
var my_cv=0
var java_script=0
var projects_1=0

}

else

{

up = "";
document.up = "";
aboutMe = "";
document.aboutme = "";
myCV = "";
document.myCV = "";
javaScript= "";
document.javaScript = "";
projects = "";
document.projects = "";

}


function evalRollon(item)

{
if (item==98) Left.up.src = (up_1==0) ? up[1] : up[3]
if (item==99) Left.up.src = (up_2==0) ? up[1] : up[3]
if (item==1) Left.about.src = (about_me==0) ? aboutMe[1] : aboutMe[3]
if (item==2) Left.cv.src = (my_cv==0) ? myCv[1] : myCv[3]
if (item==6) Left.java.src = (java_script==0) ? javaScript[1] :
javaScript[3]
if (item==8) Left.projects.src = (projects_1==0) ? projects[1] :
projects[3]
}

function evalImage(item)

{
if (item==98) Left.up.src = (up_1==0) ? up[0] : up[2]
if (item==99) Left.up.src = (up_2==0) ? up[0] : up[2]
if (item==1) Left.about.src = (about_me==0) ? aboutMe[0] : aboutMe[2]
if (item==2) Left.cv.src = (my_cv==0) ? myCv[0] : myCv[2]
if (item==6) Left.java.src = (java_script==0) ? javaScript[0] :
javaScript[2]
if (item==8) Left.projects.src = (projects_1==0) ? projects[0] :
projects[2]
}


function mainMenu()

{
parent.Left.document.close()
parent.Left.document.open()
parent.Left.document.writeln('<html><head
onLoad="top.evalImage(1)","top.evalImage(8),"top.evalImage(98)">')
parent.Left.document.writeln("<TITLE>Welcome to John Ortts Internet Page -
Contents Menu</TITLE>")
parent.Left.document.writeln('</head><body bgcolour="white">')
parent.Left.document.writeln('<P><A target=Left')

parent.Left.document.writeln('onclick="top.aboutmemenu()";"top.about_me++"')
parent.Left.document.writeln('onmouseout="top.evalImage(1)"')
parent.Left.document.writeln('onmouseover="top.evalRollon(1)">')
parent.Left.document.writeln('<img src="AboutMe.gif" alt="About Me"
width=250 height=50 border=0 name="about"></A>')
parent.Left.document.writeln('</P><P><A href="top.projects()"
target=Left')
parent.Left.document.writeln('onclick="top.projectsmenu()";
"top.projects_1++"')
parent.Left.document.writeln('onmouseout="top.evalImage(8)"')
parent.Left.document.writeln('onmouseover="top.evalRollon(8)">')
parent.Left.document.writeln('<img src="Projects.gif" alt="Projects"
width=250 height=50 border=0 name="projects"></A>')
parent.Left.document.writeln('</P>')
parent.Left.document.writeln("</body></html>")

parent.Top.document.close()
parent.Top.document.open()
parent.Top.document.writeln('<html><head><TITLE>Welcome to Johns Internet
Page</TITLE></head>')
parent.Top.document.writeln('<body bgcolour="white"><p>Title Goes
Here</p></body></html>')

}


function aboutmemenu()

{
parent.Left.document.close()
parent.Left.document.open()
parent.Left.document.writeln('<html><head
onLoad="top.evalImage(98)","top.evalImage(2)">')
parent.Left.document.writeln("<TITLE>Welcome to John Ortts Internet Page -
About Me Menu</TITLE>")
parent.Left.document.writeln('</head><body bgcolour="white">')
parent.Left.document.writeln('<P><A target=Left')
parent.Left.document.writeln('onclick="top.mainMenu()"; "top.up_1++"')
parent.Left.document.writeln('onmouseout="top.evalImage(98)"')
parent.Left.document.writeln('onmouseover="top.evalRollon(98)"')
parent.Left.document.writeln('onLoad="top.evalImage(98)">')
parent.Left.document.writeln('<img src=top.evalImage(98) alt="Up" width=250
height=50 border=0 name="up"></A>')
parent.Left.document.writeln('</P><P><A href="mycv.html" target=Right')
parent.Left.document.writeln('onclick="top.my_cv++"')
parent.Left.document.writeln('onmouseout="top.evalImage(2)"')
parent.Left.document.writeln('onmouseover="top.evalRollon(2)"')
parent.Left.document.writeln('onLoad=top.evalImage(2)>')
parent.Left.document.writeln('<img src="top.evalImage(2)" alt="My CV"
width=250 height=50 border=0 name="cv"></A>')
parent.Left.document.writeln('</P>')
parent.Left.document.writeln("</body></html>")
}

function projectsmenu()

{
parent.Left.document.close()
parent.Left.document.open()
parent.Left.document.writeln("<html><head>")
parent.Left.document.writeln("<TITLE>Welcome to John Ortts Internet Page -
About Me Menu</TITLE>")
parent.Left.document.writeln('</head><body bgcolour="white">')
parent.Left.document.writeln('<P><A target=Left')
parent.Left.document.writeln('onclick="top.mainMenu()"; "top.up_2++"')
parent.Left.document.writeln('onmouseout="top.evalImage(99)"')
parent.Left.document.writeln('onmouseover="top.evalRollon(99)"')
parent.Left.document.writeln('onLoad="top.evalImage(99)" return="false">')
parent.Left.document.writeln('<img src="top.evalImage(99)" alt="Up"
width=250 height=50 border=0 name="up"></A>')
parent.Left.document.writeln('</P><P><A href="javascript.html"
target=Right')
parent.Left.document.writeln('onclick="top.java_script++"')
parent.Left.document.writeln('onmouseout="top.evalImage(6)"')
parent.Left.document.writeln('onmouseover="top.evalRollon(6)"')
parent.Left.document.writeln('onLoad="top.evalImage(6)" return="false">')
parent.Left.document.writeln('<img src="top.evalImage(6)" alt="Java"
width=250 height=50 border=0 name="java"></A>')
parent.Left.document.writeln('</P>')
parent.Left.document.writeln("</body></html>")
}

// Stop Hiding Me. -->
</SCRIPT>
</head>

<frameset rows="80,*" framespacing="0" border="0" frameborder="NO">
<frame name="Top" noresize>

<frameset cols="250,*" framespacing="0" border="0" frameborder="NO"
onload="mainMenu()">
<frame name="Left" noresize>
<frame src="Right.html" name="Right" noresize>
</frameset>
</frameset>

<noframes>

<body>

</body>

</noframes>
</html>
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,007
Latest member
obedient dusk

Latest Threads

Top