PDA

View Full Version : ...something wrong with my HTML


Schming
10-01-2003, 09:09 PM
Here's my code, I'm trying to get the main image to flip the same time you hover over the enter button, which also flips....


<HTML>
<HEAD>
<TITLE><< SCHMING >></TITLE>

<SCRIPT>
Enter1 = new Image
Enter1.src = "images/enter.jpg"
Enter2 = new Image
Enter2.src = "images/enter1.jpg"
</script>
<SCRIPT>
Index1 = new Image
Index1.src = "/images/indexJPG.jpg"
Index2 = new Image
Index2.src = "images/indexJPG2.jpg"
</SCRIPT>

</HEAD>

<BODY BGCOLOR=black TEXT=white LINK=white VLINK=red>
<CENTER>
<TABLE BORDER=0>
<TR>
<TD>
<CENTER>
<IMG NAME=index SRC="http://schminglife.org/images/indexJPG.jpg">
</CENTER>
</TD>
</TR>
<TR>
<TD>
<CENTER>
<A href="/index.html"
onMouseOver="document.enter.src = Enter2.src;"
onMouseOut="document.enter.src = Enter1.src;"
onMouseOver="document.index.src = Index2.src;"
onMouseOut="document.index.src = Index1.src;"><IMG
src="images/enter.jpg" border=0 name=enter></a></CENTER>
</TD>
</TR>
</TABLE>

</BODY>
</HTML>


------------------
~indie rock~ (http://www.schminglife.org)

Malus
10-01-2003, 11:08 PM
I don't think you can have two mouseover and mouseout attributes. I would try combining them so you only have one mouseout and one mouseover.

------------------
[This message has been edited. Deal with it.]

SaberMaster
10-01-2003, 11:22 PM
You can't write two events in a tag like that. Here's a clean, working version:

<HTML><HEAD><TITLE><< SCHMING >></TITLE>
<SCRIPT>
enter1 = new Image;
enter1.src = "images/enter.jpg";
enter2 = new Image;
enter2.src = "images/enter1.jpg";
index1 = new Image;
index1.src = "images/indexJPG.jpg";
index2 = new Image;
index2.src = "images/indexJPG2.jpg";
</SCRIPT>
</HEAD>

<BODY BGCOLOR="black" TEXT="white" LINK="white" VLINK="red">

<CENTER><TABLE BORDER=0>
<TR><TD>
<CENTER><IMG NAME="index" SRC="images/indexJPG.jpg"></CENTER>
</TD></TR>
<TR><TD>
<CENTER>
<A href="index.html" onMouseOver="document.enter.src = enter2.src; document.index.src = index2.src;"
onMouseOut="document.enter.src = enter1.src; document.index.src = index1.src;">
<IMG src="images/enter.jpg" border="0" name="enter">
</A>
</CENTER>
</TD></TR>
</TABLE>

</BODY></HTML>


------------------
Author of the JK DataMaster (http://www.geocities.com/sabersdomain/files.html), Parsec (http://www.geocities.com/sabersdomain/files.html), Scribe (http://www.geocities.com/sabersdomain/files.html), and the EditPlus Cog Files (http://www.geocities.com/sabersdomain/files.html).

Schming
10-02-2003, 08:10 AM
Thanks, I never really went that deep into that kind of coding...

------------------
~indie rock~ (http://www.schminglife.org)

herb
10-04-2003, 09:24 PM
it is advisable to define what sort of script you are using, i.e. script language="javascript"