Closed Thread Icon

Topic awaiting preservation: Rollover Button (Page 1 of 1) Pages that link to <a href="https://ozoneasylum.com/backlink?for=8533" title="Pages that link to Topic awaiting preservation: Rollover Button (Page 1 of 1)" rel="nofollow" >Topic awaiting preservation: Rollover Button <span class="small">(Page 1 of 1)</span>\

 
Hiroki
Paranoid (IV) Inmate

From: NZ
Insane since: Dec 2002

posted posted 02-17-2003 00:23

Hi, guys. Please help me&#8230;.

I am making &#8220;rollover button&#8221;. I know it is pretty basic but doesn&#8217;t work. My code is following:

<head>
<script language="JavaScript">
function HiroRollover(imgNum,imgSrc)
{document.images[imgNum].src=imgSrc;}
</script>
<link rel="stylesheet" type="text/css" href="../css/text.css"/>
</head>

<tr>
<td colspan="3" height="10%" align="right">
<a href="homestay.htm"
onMouseover=HiroRollover(0,'../button/homestay.gif');"
onMouseout="HiroRollover(0,../button/homestayrollover2.gif');">
<img src="../button/homestayrollover2.gif" border="0">
</a>

I don&#8217;t know why. It seems to me fine. How about you?




Hiroki Kozai

bitdamaged
Maniac (V) Mad Scientist

From: 100101010011 <-- right about here
Insane since: Mar 2000

posted posted 02-17-2003 00:58

A. You're missing a opening quote in the onMouseOut

B. it's easier and cleaner to just name your images and use the name for your mouseovers


<head>
<script language="JavaScript">
function HiroRollover(imgName,imgSrc)
{document.images[imgName].src=imgSrc;}
</script>
<link rel="stylesheet" type="text/css" href="../css/text.css"/>
</head>

<tr>
<td colspan="3" height="10%" align="right">
<a href="homestay.htm"
onMouseover=HiroRollover('myImage', '../button/homestay.gif');"
onMouseout="HiroRollover('myImage', '../button/homestayrollover2.gif');">
<img src="../button/homestayrollover2.gif" border="0" name="myImage">
</a>




.:[ Never resist a perfect moment ]:.

Hiroki
Paranoid (IV) Inmate

From: NZ
Insane since: Dec 2002

posted posted 02-17-2003 02:04

Hi, Bitdamaged! Thanks a lot. It is working now.
I am excited about it!!!!!

And now I am putting other buttons just next to my first button. What I am doing is coding exacty same way and put it under first script. Is that right?

Have a good day.

By the way, Are you bit damaged or something damaged? I am juust wondering.

Cheers.

Hiroki Kozai

Hiroki
Paranoid (IV) Inmate

From: NZ
Insane since: Dec 2002

posted posted 02-17-2003 02:15

sorry to bother you. It doesn't work well.

Here is my script:

<head>
<script language="JavaScript">
function HiroRollover(imgName,imgSrc)
{document.images[imgName].src=imgSrc;}
</script>
<link rel="stylesheet" type="text/css" href="../css/text.css"/>
</head>

and in body section:

<a href="homestay.htm"
onMouseover="HiroRollover('myImage', '../button/homestayrollover2.gif');"
onMouseout="HiroRollover('myImage', '../button/homestay.gif');">
<img src="../button/homestay.gif" border="0" name="myImage">
</a>

<a href="trip.htm"
onmouseover="HiroRollover('myImage','../button/triprollover.gif');"
onmouseout="HiroRollover('myImage','../button/trip.gif');">
<img src="../button/trip.gif" border="0" name="myImage">
</a>

It seems to me fine. But if I hover homestay button, trip button has been changed. Even it is being changed into homestay button instead of trip button. Why why why????


Hiroki Kozai

[This message has been edited by Hiroki (edited 02-17-2003).]

bitdamaged
Maniac (V) Mad Scientist

From: 100101010011 <-- right about here
Insane since: Mar 2000

posted posted 02-17-2003 02:46

You need to name all your images differently and then call that image specfically
The name is how the script tells your images apart so you need to name them "myImage1" myImage2 etc.

Actually normally I name my images the same as the button.






.:[ Never resist a perfect moment ]:.

Hiroki
Paranoid (IV) Inmate

From: NZ
Insane since: Dec 2002

posted posted 02-17-2003 02:58

Thanks a lot. It is working properly now.
I am pretty happyyyy!
See you, Bitdamaged.

Hiroki Kozai

« BackwardsOnwards »

Show Forum Drop Down Menu