Thread View: aus.computers.java
3 messages
3 total messages
Started by VanCezanne
Sat, 08 May 1999 00:00
Whats wrong with this code...?
Author: VanCezanne
Date: Sat, 08 May 1999 00:00
Date: Sat, 08 May 1999 00:00
209 lines
5527 bytes
5527 bytes
Hi, I cut, pasted, and slightly altered some java code from
http://www.htmlgoodies.com/beyond/dualflip.html
which does the mouseover-change-remote-image thing. The java works,
but my Netscape stand alone 4.08 has a javascript error message in the
status bar.
This is what the page looks like......
http://www.villagehost.com/temp/new/altered_multi5.htm
Below is both the orginal code and my altered version.
Can you see what i'm doing wrong?
Thanks! :)
ORIGINAL CODE:
================
<SCRIPT LANGUAGE="JavaScript">
//This script changes the graphic on mouse over and a graphic in
//another part of the screen
{
alt0 = new Image();
alt0.src = "white.gif";
alt1 = new Image();
alt1.src = "hg_banner.gif";
alt2 = new Image();
alt2.src = "jg_banner.gif";
graphic1= new Image();
graphic1.src = "but1.gif";
graphic1on = new Image();
graphic1on.src = "but1b.gif";
graphic2= new Image();
graphic2.src = "but2.gif";
graphic2on = new Image();
graphic2on.src = "but2b.gif";
}
function imageChange(imageID,imageName,imageID2,imageName2) {
{
document.images[imageID].src = eval(imageName + ".src");
document.images[imageID2].src = eval(imageName2 + ".src");
}
}
</script>
<center>
<TABLE border="0">
<TR>
<TD>
<A HREF="/"
ONMOUSEOVER="imageChange('global','alt1','one','graphic1on')"
ONMOUSEOUT="imageChange('global','alt0','one','graphic1')">
<IMG SRC="but1.gif" BORDER="0" NAME="one"></A><BR><BR>
<A HREF="http://www.javagoodies.com"
ONMOUSEOVER="imageChange('global','alt2','two','graphic2on')"
ONMOUSEOUT="imageChange('global','alt0','two','graphic2')">
<IMG SRC="but2.gif" BORDER="0" NAME="two"></A>
</TD>
<TD>
<IMG SRC="white.gif" WIDTH="130" HEIGHT="130" NAME="global" >
</TD>
</TR>
</TABLE>
============
MY ALTERED VERSION
============
<script language="JavaScript">
//This script changes the graphic on mouse over and a graphic in
//another part of the screen
{
alt0 = new Image();
alt0.src = "circle_welcome.gif";
alt1 = new Image();
alt1.src = "circle_clients.gif";
alt2 = new Image();
alt2.src = "circle_prices.gif";
alt3 = new Image();
alt3.src = "circle_styles.gif";
alt4 = new Image();
alt4.src = "circle_contact.gif";
graphic1= new Image();
graphic1.src = "3a.gif";
graphic1on = new Image();
graphic1on.src = "3a2.gif";
graphic2= new Image();
graphic2.src = "3b.gif";
graphic2on = new Image();
graphic2on.src = "3b2.gif";
graphic3= new Image();
graphic3.src = "3c.gif";
graphic3on = new Image();
graphic3on.src = "3c2.gif";
graphic4= new Image();
graphic4.src = "3d.gif";
graphic4on = new Image();
graphic4on.src = "3d2.gif";
}
function
imageChange(imageID,imageName,imageID2,imageName2,imageID3,imageName3,imageID4,imageName4)
{
{
document.images[imageID].src = eval(imageName + ".src");
document.images[imageID2].src = eval(imageName2 + ".src");
document.images[imageID3].src = eval(imageName3 + ".src");
document.images[imageID4].src = eval(imageName4 + ".src");
}
}
</script>
</head>
<body background=beige4.gif>
<center>
<table border="0" cellpadding=0 cellspacing=0>
<tr align=center>
<td>
<img src="1.gif" width=246 height=90 border=0>
</td>
</tr>
<tr align=center>
<td>
<img src="2.gif" width=315 height=24 border=0>
</td>
</tr>
<tr>
<td>
<table border="0" cellpadding=0 cellspacing=0>
<tr>
<td>
<a href="clients.htm"
onmouseover="imageChange('global','alt1','one','graphic1on')"
onmouseout="imageChange('global','alt0','one','graphic1')">
<img src="3a.gif" border="0" name="one"></a></td><td>
<a href="prices.htm"
onmouseover="imageChange('global','alt2','two','graphic2on')"
onmouseout="imageChange('global','alt0','two','graphic2')">
<img src="3b.gif" border="0" name="two"></a></td><td>
<a href="styles.htm"
onmouseover="imageChange('global','alt3','three','graphic3on')"
onmouseout="imageChange('global','alt0','three','graphic3')">
<img src="3c.gif" border="0" name="three"></a></td><td>
<a href="contact.htm"
onmouseover="imageChange('global','alt4','four','graphic4on')"
onmouseout="imageChange('global','alt0','four','graphic4')">
<img src="3d.gif" border="0" name="four"></a>
</td>
</tr>
</table>
</td>
</tr>
<tr align=center>
<td>
<br>
<img src="circle_welcome.gif" width=129 height=128 name="global" >
</td>
</tr>
</table>
<br>
<table>
<tr>
<td>
<font size="-2" face="Arial">
<strong><a href="kdjd.htm"><font color="#C00000">C l i e n t
s</font></a></strong> <font color="#844E1A">||</font>
<strong><a href="kdjd.htm"><font color="#C00000">P r i c e
s</font></a></strong> <font color="#844E1A">||</font>
<strong><a href="kdjd.htm"><font color="#C00000">S t y l e
s</font></a></strong> <font color="#844E1A">||</font>
<strong><a href="kdjd.htm"><font color="#C00000">C o n t a c t
U s</font></a></strong>
</font>
</td>
</tr>
</table>
Re: Whats wrong with this code...?
Author: B&B
Date: Sat, 08 May 1999 00:00
Date: Sat, 08 May 1999 00:00
6 lines
937 bytes
937 bytes
this is java != javascript -- B&B B_and_B@wargazm.freeserve.co.uk
Re: Whats wrong with this code...?
Author: VanCezanne
Date: Tue, 11 May 1999 00:00
Date: Tue, 11 May 1999 00:00
12 lines
797 bytes
797 bytes
Pardon my ingorance, but what does that mean? What do I need to do/change? Thanks! :) >this is java !=3D javascript > >--=20 > >B&B
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads