View Full Version : rollovers, can someone take a look?


vicary
06-09-2003, 01:21 AM
Can someone take a look at this source code at this link (http://members.kconline.com/vicary/metallic.html) ?

I have tried and tried to get this one right, to no avail. Am I missing something? I even tried two different tutorials (lissa's and htmlgoodies) and I still cannot get it right.

TIA

MaGiCSuN
06-09-2003, 04:04 PM
try this:

<script language="JavaScript">
<!-- Hide the script from old browsers --
<SCRIPT LANGUAGE="JavaScript">
<!-- hide from none JavaScript Browsers
Image1= new Image(225,28)
Image1.src = "rollovers/home1.jpg"
Image2 = new Image(225,28)
Image2.src = "rollovers/home2.jpg"

function SwapOut() {
document.imageflip.src = Image1.src; return true;
}

function SwapBack() {
document.imageflip.src = Image2.src; return true;
}

// - stop hiding -->
</SCRIPT>

I looked and the blue one is home2.jpg, the yellow one is home1.jpg

you have image1.src as yellow, and image2.src as blue and this is your link code:

<A HREF="metallic.html" onMouseOver="SwapOut()" onMouseOut="SwapBack()">
<IMG NAME="imageflip" SRC="rollovers/home2.jpg" WIDTH=225 HEIGHT=28 BORDER=0></A>

the regular image is blue, but the onmouseover is set to swapout, if you look at your source you have set swapout to image2.src, and image 2 is the blue one :) get it? so i switched the swapout and swapback, and it should work fine now

also one little thing:

background-image: graphics(rockimg.gif');

that should be:

background-image: url(rockimg.gif);

;) good luck !!!

Love,
Mirna

the_dark_one02
06-09-2003, 04:23 PM
i dont know where you got that code from but thats the hard way.
this is the easy way:

<a href="your link" onMouseOver="document.MyImage.src='rollovers/home1.jpg';"
onMouseOut="document.MyImage.src='rollovers/home2.jpg';">
<img src="rollovers/home2.jpg" name="MyImage">

by the way if you want to change the name of the image etc you'll have to change ALL of the bold MyImage ' s

the_dark_one02
06-09-2003, 04:25 PM
lol we must have written them at the same time