473,804 Members | 2,147 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Repost: Javascript Rollovers not Refreshing on Dynamic Webpages.

I appologise for reposting this but I have been trying to find a solution
all week with no avail and I was hoping a repost might help somebody more
knowledgable than myself to spot the message...

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>Welcom e to John Ortt's Homepage</title>
<html>

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

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

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

if (document.image s)

{

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","MyC VFP.gif");
javaScript = new
Array("Javascri pt.gif","Javasc riptF.gif","Jav ascriptP.gif"," JavascriptFP.gi f
");
projects = new
Array("Projects .gif","Projects F.gif","Project sP.gif","Projec tsFP.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.aboutm e = "";
myCV = "";
document.myCV = "";
javaScript= "";
document.javaSc ript = "";
projects = "";
document.projec ts = "";

}
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.s rc = (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.s rc = (projects_1==0) ? projects[0] :
projects[2]
}
function mainMenu()

{
parent.Left.doc ument.close()
parent.Left.doc ument.open()
parent.Left.doc ument.writeln(' <html><head
onLoad="top.eva lImage(1)","top .evalImage(8)," top.evalImage(9 8)">')
parent.Left.doc ument.writeln(" <TITLE>Welcom e to John Ortts Internet Page -
Contents Menu</TITLE>")
parent.Left.doc ument.writeln(' </head><body bgcolour="white ">')
parent.Left.doc ument.writeln(' <P><A target=Left')

parent.Left.doc ument.writeln(' onclick="top.ab outmemenu()";"t op.about_me++"' )
parent.Left.doc ument.writeln(' onmouseout="top .evalImage(1)"' )
parent.Left.doc ument.writeln(' onmouseover="to p.evalRollon(1) ">')
parent.Left.doc ument.writeln(' <img src="AboutMe.gi f" alt="About Me"
width=250 height=50 border=0 name="about"></A>')
parent.Left.doc ument.writeln(' </P><P><A href="top.proje cts()"
target=Left')
parent.Left.doc ument.writeln(' onclick="top.pr ojectsmenu()";
"top.projects_1 ++"')
parent.Left.doc ument.writeln(' onmouseout="top .evalImage(8)"' )
parent.Left.doc ument.writeln(' onmouseover="to p.evalRollon(8) ">')
parent.Left.doc ument.writeln(' <img src="Projects.g if" alt="Projects"
width=250 height=50 border=0 name="projects" ></A>')
parent.Left.doc ument.writeln(' </P>')
parent.Left.doc ument.writeln(" </body></html>")

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

}
function aboutmemenu()

{
parent.Left.doc ument.close()
parent.Left.doc ument.open()
parent.Left.doc ument.writeln(' <html><head
onLoad="top.eva lImage(98)","to p.evalImage(2)" >')
parent.Left.doc ument.writeln(" <TITLE>Welcom e to John Ortts Internet Page -
About Me Menu</TITLE>")
parent.Left.doc ument.writeln(' </head><body bgcolour="white ">')
parent.Left.doc ument.writeln(' <P><A target=Left')
parent.Left.doc ument.writeln(' onclick="top.ma inMenu()"; "top.up_1++ "')
parent.Left.doc ument.writeln(' onmouseout="top .evalImage(98)" ')
parent.Left.doc ument.writeln(' onmouseover="to p.evalRollon(98 )"')
parent.Left.doc ument.writeln(' onLoad="top.eva lImage(98)">')
parent.Left.doc ument.writeln(' <img src=top.evalIma ge(98) alt="Up" width=250
height=50 border=0 name="up"></A>')
parent.Left.doc ument.writeln(' </P><P><A href="mycv.html " target=Right')
parent.Left.doc ument.writeln(' onclick="top.my _cv++"')
parent.Left.doc ument.writeln(' onmouseout="top .evalImage(2)"' )
parent.Left.doc ument.writeln(' onmouseover="to p.evalRollon(2) "')
parent.Left.doc ument.writeln(' onLoad=top.eval Image(2)>')
parent.Left.doc ument.writeln(' <img src="top.evalIm age(2)" alt="My CV"
width=250 height=50 border=0 name="cv"></A>')
parent.Left.doc ument.writeln(' </P>')
parent.Left.doc ument.writeln(" </body></html>")
}

function projectsmenu()

{
parent.Left.doc ument.close()
parent.Left.doc ument.open()
parent.Left.doc ument.writeln(" <html><head>" )
parent.Left.doc ument.writeln(" <TITLE>Welcom e to John Ortts Internet Page -
About Me Menu</TITLE>")
parent.Left.doc ument.writeln(' </head><body bgcolour="white ">')
parent.Left.doc ument.writeln(' <P><A target=Left')
parent.Left.doc ument.writeln(' onclick="top.ma inMenu()"; "top.up_2++ "')
parent.Left.doc ument.writeln(' onmouseout="top .evalImage(99)" ')
parent.Left.doc ument.writeln(' onmouseover="to p.evalRollon(99 )"')
parent.Left.doc ument.writeln(' onLoad="top.eva lImage(99)" return="false"> ')
parent.Left.doc ument.writeln(' <img src="top.evalIm age(99)" alt="Up"
width=250 height=50 border=0 name="up"></A>')
parent.Left.doc ument.writeln(' </P><P><A href="javascrip t.html"
target=Right')
parent.Left.doc ument.writeln(' onclick="top.ja va_script++"')
parent.Left.doc ument.writeln(' onmouseout="top .evalImage(6)"' )
parent.Left.doc ument.writeln(' onmouseover="to p.evalRollon(6) "')
parent.Left.doc ument.writeln(' onLoad="top.eva lImage(6)" return="false"> ')
parent.Left.doc ument.writeln(' <img src="top.evalIm age(6)" alt="Java"
width=250 height=50 border=0 name="java"></A>')
parent.Left.doc ument.writeln(' </P>')
parent.Left.doc ument.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="mainMen u()">
<frame name="Left" noresize>
<frame src="Right.html " name="Right" noresize>
</frameset>
</frameset>

<noframes>

<body>

</body>

</noframes>
</html>

Jul 23 '05 #1
3 2168
On Tue, 30 Nov 2004 10:13:36 -0000, John Ortt
<Jo******@Idont wantspamsonoret urnaddress.com> wrote:
I am trying to write a webpage in Javascript. The page loads with three
frames, a top, left and right frame.
Stop right there. Don't use frames. Looking at your page, they are
certainly not necessary. Moreover, resorting to Javascript to provide
navigation is, well, stupid. Relying on it to provide your entire content,
which is what you seem to be doing, is even worse!

You also have several mark-up errors, both in your actual page, and the
HTML you would write to the frames. See <URL:http://validator.w3.or g/>.
Depending on the users actions the background page rewrites the code for
the relevant frames.
So why don't you have actual pages?
The problem I am having is that I have four rollover states for each
button.

"Unused", "Unused with mouseover", "Used", and "Used with mouseover".
How are these states determined? I imagine this problem disappears
entirely if you stop using frames.

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


Take a look at <URL:http://www.mlwinter.pw p.blueyonder.co .uk/image-swap/>
for an easier approach to scripted mouse-overs.

[snip]

Mike

--
Michael Winter
Replace ".invalid" with ".uk" to reply by e-mail.
Jul 23 '05 #2
Thanks Mike, I'll check out the sites you suggest.

How should I write the page without using frames if I want a Title at the
top and a menu on the left hand side?

Thanks again for the feedback, I am still relatively new to all this and any
help is greatly appreciated.

John
----- Original Message -----
From: "Michael Winter" <M.******@bluey onder.co.invali d>
Newsgroups: comp.lang.javas cript
Sent: Tuesday, November 30, 2004 12:47 PM
Subject: Re: Repost: Javascript Rollovers not Refreshing on Dynamic
Webpages.

<Lots of useful advice snip'd>
Jul 23 '05 #3
On Tue, 30 Nov 2004 13:23:50 -0000, John Ortt
<Jo******@Idont wantspamsonoret urnaddress.com> wrote:
How should I write the page without using frames if I want a Title at
the top and a menu on the left hand side?
First, mark-up the content semantically. That is, use elements that best
describe, not present, the content. How that's best done depends on your
content and, to some extent, how you want to lay out the document. For
example, you might want to use a DIV to group together some related
elements, and position that DIV somewhere.

Once you've done that, you apply presentation - position, colour, etc. -
through Cascading Style Sheets (CSS - <URL:http://www.w3.org/Style/CSS/>).

At a basic level, you might have:

<h1>Page title</h1>
<ul>
<li><a href="...">Link to another section</a></li>
<li><a href="...">Link to another section</a></li>
<li><a href="...">Link to another section</a></li>
</ul>
<div>
Your content
</div>

Styling that would involve at least:

- Changing the size, and probably style too, of the title.
- Removing the padding and list markers from the list of links, and
- Moving the list to a position on the left of the viewport, and
the content to the right of that.

Be aware that some will argue that navigation links should be last in the
source and moved to the right location by CSS:

<h1>Page title</h1>
<!-- The link below would be hidden for normal visitors, --
-- but rendered for disabled users and text browsers. -->
<a href="#navigati on">Skip to navigation links</a>
<div>
Your content
</div>
<ul id="navigation" >
<li><a href="...">Link to another section</a></li>
<li><a href="...">Link to another section</a></li>
<li><a href="...">Link to another section</a></li>
</ul>

The reason is that visitors using screen readers and other accessibility
devices, or visitors using text browsers or browsers that don't support
the CSS used, won't be bombarded by a large list of links at the start of
the page.

The better place to ask about this is in alt.html or
comp.infosystem s.www.authoring.html. CSS questions should be directed to
comp.infosystem s.www.authoring.stylesheets.
Thanks again for the feedback, I am still relatively new to all this and
any help is greatly appreciated.


By the way, it's very misleading to have "Java" as the alt text for your
Javascript image. Javascript is not Java.

[snip]

Good luck,
Mike

--
Michael Winter
Replace ".invalid" with ".uk" to reply by e-mail.
Jul 23 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

8
2838
by: Michel | last post by:
What free programs, where to download and how to install and start programming a dynamic website that enables visitors to log in, lookup and write data in/from a serversite database. So how can I write and test it without internet on a win98se pentium? thanks
2
2300
by: Steve Lockridge | last post by:
We have recently created simple javascript rollovers on a site using Macromedia Fireworks. What is weird is that four of them work and one doesn't on the Mac platform using Safari and IE. The NN and Camino browsers work. Before I give you the URL, I wanted to let you know I am not referring to the swap image behavior. I am referring to the simple rollover where the OnMouseOver state puts a green glow behind the text. ...
6
1367
by: Leythos | last post by:
I have a site at http://www.bhlnet.net/opep, it's template site for testing, it uses roll-over images that are setup/controlled by javascript. I've just noticed that the pages seem to be stuck with READ/Waiting in the status message. When I use IE I don't see the READ/Waiting. If I remove the js I don't see it, if I refresh the page and don't hold the mouse over any button I don't see it, I've tested with virgin code.... Any ideas?
0
301
by: chris | last post by:
Hello Group, I have been trying to read books about ASP.NET/VB.NET. Cant really figure out a good way to design neat web pages using VS.NET. I would appreciate if anyone can give me some pointers wherein I can get to learn step by step creation of web pages using VS.NET. I am a beginner in .NET. Thanks, Chris.
0
913
by: Les Caudle | last post by:
Anyone have some sample code for a database generated menu based on a DataList (or other control). that would also generate the javascript necessary for a rollover to a 2nd image when the mouse moves over the image? -- Thanks in advance, Les Caudle
104
17026
by: Leszek | last post by:
Hi. Is it possible in javascript to operate on an array without knowing how mamy elements it has? What i want to do is sending an array to a script, and this script should add all values from that array Could you show me a little example how to do this? Thanks.
1
13207
by: mayur_hirpara | last post by:
Hi, I am looking to call a javascript function using variable number of parameters. Suppose I have a function foo(param) { ..... } I want it to be called unpredictebly when certain action occurs. For example, I am using AJAX to make server call and get some data.
5
1884
by: Dinsdale | last post by:
Without using CSS styles or linked stylesheets, I need to apply formatting to text links that use rollover effects. I can NOT get the underline to show using this technique: <A onmouseover="this.style.color='#000000'" style="FONT-SIZE: 12pt; COLOR: #000000; FONT-FAMILY: Arial, Helvetica; TEXT-DECORATION: underline;" onmouseout="this.style.color='#000000' TEXT-DECORATION: none;" href="#">Search</A>
0
9593
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10343
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10335
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10088
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9169
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7633
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6862
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5668
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3831
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.