ugel
03-23-2004, 09:03 AM
I am able to program a mouse over/out script successfully when placing the image inside of <a href...> (rollover.html).
I need to do the same function with an image inside of an INPUT TYPE=IMAGE (rollover2.html).
I receive an error message indicating that 'document.imageflip' is null or not an object.
I'm somewhat new at this so I'm not sure what I am missing or even if I can do this with INPUT TYPE=IMAGE.
ROLLOVER
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Untitled</title>
<SCRIPT LANGUAGE="JavaScript">
<!-- hide from none JavaScript Browsers
Image1= new Image(150,20)
Image1.src = "../kwpics/Absentee.jpg"
Image2 = new Image(150,20)
Image2.src = "../kwpics/AbsenteeY.jpg"
function SwapOut() {
document.imageflip.src = Image2.src; return true;
}
function SwapBack() {
document.imageflip.src = Image1.src; return true;
}
// - stop hiding -->
</SCRIPT>
</head>
<body>
<table>
<tr>
<td>
<A HREF="/" onMouseOver="SwapOut()" onMouseOut="SwapBack()">
<img src="../kwpics/Absentee.jpg" alt="" name="imageflip" id="imageflip" width="150" height="20" border="0">
</A>
</td>
</tr>
</table>
</body>
</html>
ROLLOVER2
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Untitled</title>
<SCRIPT LANGUAGE="JavaScript">
<!-- hide from none JavaScript Browsers
Image1= new Image(150,20)
Image1.src = "../kwpics/Absentee.jpg"
Image2 = new Image(150,20)
Image2.src = "../kwpics/AbsenteeY.jpg"
function SwapOut() {
document.imageflip.src = Image2.src; return true;
}
function SwapBack() {
document.imageflip.src = Image1.src; return true;
}
// - stop hiding -->
</SCRIPT>
</head>
<body>
</table>
<tr>
<td style="background-color: #295284;">
<input type="image" name="imageflip" id="imageflip" value="Absentee" src="../kwpics/Absentee.jpg" align="middle" title="Run Absentee Report." onClick="goButton('CLK911')" onMouseOver="SwapOut()" onMouseOut="SwapBack()">
</td>
</tr>
</table>
</body>
</html>
Any help would be greatly appreciated,
Sincerely, Ugel
I need to do the same function with an image inside of an INPUT TYPE=IMAGE (rollover2.html).
I receive an error message indicating that 'document.imageflip' is null or not an object.
I'm somewhat new at this so I'm not sure what I am missing or even if I can do this with INPUT TYPE=IMAGE.
ROLLOVER
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Untitled</title>
<SCRIPT LANGUAGE="JavaScript">
<!-- hide from none JavaScript Browsers
Image1= new Image(150,20)
Image1.src = "../kwpics/Absentee.jpg"
Image2 = new Image(150,20)
Image2.src = "../kwpics/AbsenteeY.jpg"
function SwapOut() {
document.imageflip.src = Image2.src; return true;
}
function SwapBack() {
document.imageflip.src = Image1.src; return true;
}
// - stop hiding -->
</SCRIPT>
</head>
<body>
<table>
<tr>
<td>
<A HREF="/" onMouseOver="SwapOut()" onMouseOut="SwapBack()">
<img src="../kwpics/Absentee.jpg" alt="" name="imageflip" id="imageflip" width="150" height="20" border="0">
</A>
</td>
</tr>
</table>
</body>
</html>
ROLLOVER2
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Untitled</title>
<SCRIPT LANGUAGE="JavaScript">
<!-- hide from none JavaScript Browsers
Image1= new Image(150,20)
Image1.src = "../kwpics/Absentee.jpg"
Image2 = new Image(150,20)
Image2.src = "../kwpics/AbsenteeY.jpg"
function SwapOut() {
document.imageflip.src = Image2.src; return true;
}
function SwapBack() {
document.imageflip.src = Image1.src; return true;
}
// - stop hiding -->
</SCRIPT>
</head>
<body>
</table>
<tr>
<td style="background-color: #295284;">
<input type="image" name="imageflip" id="imageflip" value="Absentee" src="../kwpics/Absentee.jpg" align="middle" title="Run Absentee Report." onClick="goButton('CLK911')" onMouseOver="SwapOut()" onMouseOut="SwapBack()">
</td>
</tr>
</table>
</body>
</html>
Any help would be greatly appreciated,
Sincerely, Ugel