View Full Version : Please Help With Hovers


DisKoRnnected
01-15-2003, 11:06 AM
Sorry, I dont know how to use Java Script too much, I want hover buttons with images. I already did one, but I want more buttons for my page. Everytime I put the second code for the next button, when I see my page, the first button is gone, I dont know whats happening, Im sorry, could you explain me, Im a dork >.<.
Oh yes, and something else, how can I align the buttons to the top center? Thank you.

pb&j
01-15-2003, 02:13 PM
The first part sounds like you need to change the NAME of the second image to something different.

Can you post the coding you are using for two hover buttons and/or perhaps the page in question so it can be seen in action?

DisKoRnnected
01-15-2003, 10:58 PM
Alright, Im going to explain what I understood about the code, and when I got stuck...


<script language="JavaScript">
<!-- Hide the script from old browsers --

img0_on = new Image(152,24);
img0_on.src="http://www.boomspeed.com/hellsingx/Hover.gif";
img0_off = new Image(152,24);
img0_off.src="http://www.boomspeed.com/hellsingx/Home.gif";

img1_on = new Image(152,24);
img1_on.src="http://www.boomspeed.com/hellsingx/Hover.gif";
img1_off = new Image(152,24);
img1_off.src="http://www.boomspeed.com/hellsingx/Home.gif;

img2_on = new Image(152,24);
img2_on.src="http://www.boomspeed.com/hellsingx/Hover.gif";
img2_off = new Image(152,24);
img2_off.src="http://www.boomspeed.com/hellsingx/Actualizaciones.gif";

img3_on = new Image(152,24);
img3_on.src="http://www.boomspeed.com/hellsingx/Hover.gif";
img3_off = new Image(152,24);
img3_off.src="http://www.boomspeed.com/hellsingx/Actualizaciones.gif";

function over_image(parm_name)
{
document[parm_name].src = eval(parm_name + "_on.src");
}
function off_image(parm_name)
{
document[parm_name].src = eval(parm_name + "_off.src");
}
// --End Hiding Here -->
</script>


Okay, this is my code for two images, if I want more images, I gotta duplicate the

img3_on = new Image(152,24);
img3_on.src="http://www.boomspeed.com/hellsingx/Hover.gif";
img3_off = new Image(152,24);
img3_off.src="http://www.boomspeed.com/hellsingx/Actualizaciones.gif";


part right? Okay, now, where I get stuck in, is this...

<a href="http://www.myurlyaddayaddayadda.com/" onmouseover="over_image('img0');" onmouseout="off_image('img0')"><img src="http://www.boomspeed.com/hellsingx/Home.gif" border="0" name="img0"></a>


Now, what I dont understand is...in which tags I gotta put the code above and how, because, I pasted it for the, like 8 images I want, and they dont appear, could you please tell me in which tags I gotta put it? Please. Thank You.

DisKoRnnected
01-15-2003, 11:06 PM
Oh yeah, is there any code to place the buttons on the top center of the page? Thank you again. =)