Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Rhinorhino on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

onMouseOver function

Status
Not open for further replies.

tayeke

Technical User
Joined
Mar 27, 2006
Messages
1
Location
US
I'm a real newb to javascript and want to figure out why thsi code I have written for the onMouseover function only seems to work on the first two images. The third image with the erik image named "three" does not use the onMouseOver, but I have seen the onMouseOut working.

------------------------------------------------------------
<html>
<HEAD>
<SCRIPT LANGUAGE="JavaScript">
<!--
if (document.images) {
var pum1 = new Image();
pum1.src = " var pum2 = new Image();
pum2.src = " var tay1 = new Image();
tay1.src = " var tay2 = new Image();
tay2.src = " var erik1 = new Image();
erik1.src = " var erik2 = new Image();
erik2.src = "}

function show_erik() {
if (document.images) {
domcument["three"].src = erik2.src
}
}

function hide_erik() {
if (document.images) {
document["three"].src = erik1.src
}
}

function show_tay() {
if (document.images) {
document["two"].src = tay2.src
}
}

function hide_tay() {
if (document.images) {
document["two"].src = tay1.src
}
}

function show_rock() {
if (document.images) {
document["pum"].src = pum2.src;
}
}

function hide_rock() {
if (document.images) {
document["pum"].src = pum1.src;
}
}

//-->
</script>


<TITLE>Help Page</TITLE>
<style type="text/css">
body
{
background-image:
url('background-repeat:
no-repeat;
background-attachment:
fixed
}
</style>






<font color="grey"><H1>HELP! Page</h1>
<h2>and references</h2></font>
<hr>
</HEAD>
<BODY>
<table width=100% border=0>
<tr>
<td align=center valign=center>
<i><font color="yellow" size=+3 face="sans">Thaly</font></i><p>
<a
onMouseOver="show_rock()";
onMouseOut="hide_rock()";
onClick="window.open(' 'bio', 'toolbar=no, location=no, directories=no status=no, menubar=no, resizable=no, scrollbars=no, width=350 height=400')">
<IMG SRC=" ALT="pics of Thaly"
WIDTH="220" HEIGHT="170" hspace=12 vspace=12 name="pum" border=0></a>
</td>
<td align=center valign=center>
Reserved for Andrew
</td>
</tr>
<tr>
<td align=center valign=center>
<i><font color="yellow" size=+3 face="sans">Taylor</font></i><p>
<a
onMouseOver="show_tay()";
onMouseOut="hide_tay()";
onClick="window.open(' 'bio', 'toolbar=no, location=no, directories=no status=no, menubar=no, resizable=no, scrollbars=no, width=350 height=400')">
<IMG SRC=" ALT="pics of Taylor"
WIDTH="220" HEIGHT="170" hspace=12 vspace=12 name="two" border=0></a>
</td>
<td align=center valign=center>
<i><font color="yellow" size=+3 face="sans">Erik</font></i><p>
<a
onMouseOver="show_erik()";
onMouseOut="hide_erik()";
onClick="window.open(' 'bio', 'toolbar=no, location=no, directories=no status=no, menubar=no, resizable=no, scrollbars=no, width=350 height=400')">
<IMG SRC=" ALT="pics of Erik"
WIDTH="220" HEIGHT="170" hspace=12 vspace=12 name="three" border=0></a>
</td>
</tr>
<tr>
<td colspan=2>
<center><font size="6" color="darkblue">Other recognitions soon to come</font></center><hr>
</table>

<p>
<font color=green>If you have questions for the webmaster Taylor email me by clicking <a href="mailto:tayeke@msn.com?subject=THA" style="color:red">here</a>or if your browser does not support that then email me at tayeke@msn.com and make the subject THA.</font>
<p>
<hr>
<form action=" method="post">
<input type="hidden" name="cmd" value="_xclick">
<input type="hidden" name="business" value="tayeke@msn.com">
<input type="hidden" name="item_name" value="THA">
<input type="hidden" name="amount" value="5.00">
<input type="hidden" name="page_style" value="PayPal">
<input type="hidden" name="no_shipping" value="1">
<input type="hidden" name="return" value="<input type="hidden" name="cancel_return" value="<input type="hidden" name="currency_code" value="USD">
<input type="hidden" name="tax" value="0">
<input type="hidden" name="bn" value="PP-DonationsBF">
<input type="image" src=" border="0" name="submit" alt="Donate">
</form>
<PRE>
<HR SIZE="6" noshade>
<CENTER><A HREF=" STYLE="COLOR:ORANGE">Downloads</a> <A HREF=" STYLE="COLOR:YELLOW">Help</A> <A HREF=" STYLE="COLOR:LIMEGREEN">Forum</A> <A HREF="<HR SIZE="6" noshade>
</PRE>

</BODY>
</html>
-----------------------------------------------------------
Help would be much appreciated. The pictures are uploaded to feel free to see it working.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top