PDA

View Full Version : Mouse-over commands


Petralady
06-20-2001, 01:48 PM
I went and got a mouse over script to use on my webpages, but it doesn't seem to be working right. I don't know much at all about Java, but am trying (really I am!!). The mouse over command IS working, but when the page initially loads, all of my pics show up with the big X in the corner. As soon as I put my mouse over any of the pics, they do end up showing up... and then the mouse over pic shows up too. From that point on, it is all ok. The pics do exactly what they are supposed to do. I just have that problem of when it is first brought up .. NONE of the pics show up. Can anyone help me with this?
Come and look at it at http://www.alltel.net/~niccat/dawn/pet.htm I just can't seem to get it to work.
Thanks!

pixelmonkey
06-20-2001, 01:56 PM
please post the source code for your page. it's likely the image addressing you have for your base images is incorrect.

chris<pixelmonkey>:monkey:

Mark
06-20-2001, 02:08 PM
here's his code:

<html>

<head>
<meta http-equiv="Content-Type"
content="text/html; charset=iso-8859-1">
<meta name="GENERATOR" content="Microsoft FrontPage Express 2.0">
<title>pet</title>
</head>

<body bgcolor="#8080FF" link="#FFFF00">
<script language="javascript">
<!--

/*Visit A1javascripts.com for more neat scripts*/

a1=new Image(59,47)
a1.src="http://www.bloomfieldgifts.com/images/bear.jpg"
a2=new Image(59,47)
a2.src="http://www.alltel.net/~niccat/dawn/star.jpg"
b1=new Image(59,47)
b1.src="http://www.bloomfieldgifts.com/images/tbear.jpg"
c1=new Image(59,47)
c1.src="http://www.bloomfieldgifts.com/images/wolf.jpg"
d1=new Image(59,47)
d1.src="http://www.bloomfieldgifts.com/images/polar.jpg"
e1=new Image(59,47)
e1.src="http://www.bloomfieldgifts.com/images/collie.jpg"
f1=new Image(59,47)
f1.src="http://www.bloomfieldgifts.com/images/catbw.jpg"
g1=new Image(59,47)
g1.src="http://www.bloomfieldgifts.com/images/snos.jpg"
//-->
</script><script>
<!--
function filter(imagename,objectsrc){
if (document.images)
document.images[imagename].src=eval(objectsrc+".src")
}
//-->
</script>

<p align="center"><font size="7" face="Formal436 BT"><strong><u>Incredible
Petables</u></strong></font></p>
<div align="center"><center>

<table border="1" cellspacing="1" width="50%"
bordercolor="#0000FF">
<tr>
<td align="center" width="1%" bgcolor="#000000"><!-- --> <a
href="http://www.bloomfieldgifts.com/orderform.html"
onmouseover="filter('img1','a2'); window.status='Order Here';return true;"
onmouseout="filter('img1','a1'); window.status='';return true;"
onclick="window.focus()"><img
src="http://www.bloomfieldgifts.com/bear.jpg" border="0"
width="100" height="120" name="img1"></a> <!-- --> </td>
<td align="center" width="20%" bgcolor="#FFFFFF"><font
face="Copperplate Gothic Light">14&quot; </font><p><font
face="Copperplate Gothic Light">Black Bear</font></p>
</td>
<td align="center" width="10%" bgcolor="#FFFFFF"><font
face="Copperplate Gothic Light">$16.50</font></td>
</tr>
<tr>
<td align="center" width="1%" bgcolor="#000000"><!-- --> <a
href="http://www.bloomfieldgifts.com/orderform.html"
onmouseover="filter('img2','a2'); window.status='Order Here';return true;"
onmouseout="filter('img2','b1'); window.status='';return true;"
onclick="window.focus()"><img
src="http://www.bloomfieldgifts.com/tbear.jpg" border="0"
width="100" height="120" name="img2"></a> <!-- --> </td>
<td align="center" width="20%" bgcolor="#FFFFFF"><font
face="Copperplate Gothic Light">15&quot; </font><p><font
face="Copperplate Gothic Light">Dexter Bear</font></p>
</td>
<td align="center" width="10%" bgcolor="#FFFFFF"><font
face="Copperplate Gothic Light">$26.50</font></td>
</tr>
<tr>
<td align="center" width="1%" bgcolor="#000000"><!-- --> <a
href="http://www.bloomfieldgifts.com/orderform.html"
onmouseover="filter('img3','a2'); window.status='Order Here';return true;"
onmouseout="filter('img3','c1'); window.status='';return true;"
onclick="window.focus()"><img
src="http://www.bloomfieldgifts.com/wolf.jpg" border="0"
width="100" height="120" name="img3"></a> <!-- --></td>
<td align="center" width="20%" bgcolor="#FFFFFF"><font
face="Copperplate Gothic Light">17&quot; </font><p><font
face="Copperplate Gothic Light">Wolf</font></p>
</td>
<td align="center" width="10%" bgcolor="#FF0000"><font
face="Copperplate Gothic Light">SOLD OUT</font></td>
</tr>
<tr>
<td align="center" width="1%" bgcolor="#000000"><!-- --> <a
href="http://www.bloomfieldgifts.com/orderform.html"
onmouseover="filter('img4','a2'); window.status='Order Here';return true;"
onmouseout="filter('img4','d1'); window.status='';return true;"
onclick="window.focus()"><img
src="http://www.bloomfieldgifts.com/polar.jpg" border="0"
width="100" height="120" name="img4"></a> <!-- --></td>
<td align="center" width="20%" bgcolor="#FFFFFF"><font
face="Copperplate Gothic Light">17&quot; </font><p><font
face="Copperplate Gothic Light">Polar Bear</font></p>
</td>
<td align="center" width="10%" bgcolor="#FFFFFF"><font
face="Copperplate Gothic Light">$26.50</font></td>
</tr>
<tr>
<td align="center" width="1%" bgcolor="#000000"><!-- --> <a
href="http://www.bloomfieldgifts.com/orderform.html"
onmouseover="filter('img5','a2'); window.status='Order Here';return true;"
onmouseout="filter('img5','e1'); window.status='';return true;"
onclick="window.focus()"><img
src="http://www.bloomfieldgifts.com/collie.jpg"
border="0" width="100" height="120" name="img5"></a> <!-- --></td>
<td align="center" width="20%" bgcolor="#FFFFFF"><font
face="Copperplate Gothic Light">17&quot; </font><p><font
face="Copperplate Gothic Light">Collie</font></p>
</td>
<td align="center" width="10%" bgcolor="#FFFFFF"><font
face="Copperplate Gothic Light">$26.50</font></td>
</tr>
<tr>
<td align="center" width="1%" bgcolor="#000000"><!-- --> <a
href="http://www.bloomfieldgifts.com/orderform.html"
onmouseover="filter('img6','a2'); window.status='Order Here';return true;"
onmouseout="filter('img6','e1'); window.status='';return true;"
onclick="window.focus()"><img
src="http://www.bloomfieldgifts.com/collie.jpg"
border="0" width="100" height="120" name="img6"></a> <!-- --> </td>
<td align="center" width="20%" bgcolor="#FFFFFF"><font
face="Copperplate Gothic Light">8&quot; </font><p><font
face="Copperplate Gothic Light">Collie</font></p>
</td>
<td align="center" width="10%" bgcolor="#FFFFFF"><font
face="Copperplate Gothic Light">$11.50</font></td>
</tr>
<tr>
<td align="center" width="1%" bgcolor="#000000"><!-- --> <a
href="http://www.bloomfieldgifts.com/orderform.html"
onmouseover="filter('img7','a2'); window.status='Order Here';return true;"
onmouseout="filter('img7','f1'); window.status='';return true;"
onclick="window.focus()"><img
src="http://www.bloomfieldgifts.com/catbw.jpg" border="0"
width="100" height="120" name="img7"></a> <!-- --></td>
<td align="center" width="20%" bgcolor="#FFFFFF"><font
face="Copperplate Gothic Light">15&quot; </font><p><font
face="Copperplate Gothic Light">Black &amp; White Cat</font></p>
</td>
<td align="center" width="10%" bgcolor="#FF0000"><font
face="Copperplate Gothic Light">SOLD OUT</font></td>
</tr>
<tr>
<td align="center" width="1%" bgcolor="#000000"><!-- --> <a
href="http://www.bloomfieldgifts.com/orderform.html"
onmouseover="filter('img8','a2'); window.status='Order Here';return true;"
onmouseout="filter('img8','g1'); window.status='';return true;"
onclick="window.focus()"><img
src="http://www.bloomfieldgifts.com/snos.jpg" border="0"
width="100" height="120" name="img8"></a> <!-- --> </td>
<td align="center" width="20%" bgcolor="#FFFFFF"><font
face="Copperplate Gothic Light">9&quot; </font><p><font
face="Copperplate Gothic Light">Schnauzer</font></p>
</td>
<td align="center" width="10%" bgcolor="#FFFFFF"><font
face="Copperplate Gothic Light">$11.50</font></td>
</tr>
</table>
</center></div>

<p align="center"><a
href="http://www.alltel.net/~niccat/dawn/cele.htm" target="see"><img
src="http://www.alltel.net/~niccat/dawn/home.jpg" border="0"
hspace="15" width="171" height="55"></a><a
href="mailto:sales@bloomfieldgifts.com?subject=Qustion"><img
src="http://www.alltel.net/~niccat/dawn/email.jpg" border="0"
hspace="15" width="171" height="55"></a></p>
</body>
</html>


I also think it's your path to the image thats wrong.

Petralady
06-20-2001, 02:16 PM
This is me again... I have been messing around with the img src and stuff like that for hours now and cannot figure out where the problem is. I keep changing things around, but nothing is working. Anyone have any clue where I have gone wrong by looking at the source code up there?
Thanks so much! :)
Catrina

Mark
06-20-2001, 02:17 PM
it is wrong.


notice that in the array your path is a different one than the path in the <img> tag.

e.g.

a1=new Image(59,47)
a1.src="http://www.bloomfieldgifts.com/images/bear.jpg"


the above is the right picture path, BUT in the <img> tag one is wrong:


<a
href="http://www.bloomfieldgifts.com/orderform.html"
onmouseover="filter('img1','a2'); window.status='Order Here';return true;"
onmouseout="filter('img1','a1'); window.status='';return true;" onclick="window.focus()"><img
src="http://www.bloomfieldgifts.com/bear.jpg" border="0" width="100" height="120"
name="img1"></a>


Notice that the path in the array is differ. from the path in the image tag. The array path is right while the image tag path is wrong. The same idea goes for the rest of your pics.

pixelmonkey
06-20-2001, 02:18 PM
thanks mark, i'm just now re-visiting


you are right
chris<pixelmonkey>:monkey:

Petralady
06-21-2001, 08:51 AM
Thank you so much! :)