Click to See Complete Forum and Search --> : Image rollovers


Gyrogeorge
05-25-2003, 07:30 AM
I am new to javascript so my problem is basic but I have to ask anyway. I wroe out a page with some image rollover links in a table at the side of the page. They work fine on my hard drive but online two of the images arent there at all, none of the rollovers work and two of the links dont work. If anyone doesnt mind checking it this is the part of the code thats causing problems,
<head> <script language="javascript">
function switchem(whichImage,whichPic) {document.images[whichImage].src=whichPic;}
function switchback(whichImage,whichPic) {document.images[whichImage].src=whichPic;}
</script> </head>

<body>
<table width="10%" bordercolor="red" border="2" align="left">
<tr><td><a href="frontpage.html" onMouseOver="switchem('pic1','images/homebtn2.jpg')" onMouseOut="switchback('pic1','images/homebtn1.jpg')"><img src="images/homebtn1.jpg" name="pic1" title="Home of the grave and the land of the gee"></a></td></tr>
<tr><td><a href="news.html" onMouseOver="switchem('pic4','images/newsbtn2.jpg')" onMouseOut="switchback('pic4','images/newsbtn1.jpg')"><img src="images/newsbtn1.jpg" name="pic4"></a></td></tr>
<tr><td><a href="articles.html" onMouseOver="switchem('pic2','images/articlesbtn2.jpg')" onMouseOut="switchback('pic2','images/articlesbtn1.jpg')"><img src="images/articlesbtn1.jpg" name="pic2"></a></td></tr>
<tr><td><a href="photography.html" onMouseOver="switchem('pic3','images/photosbutton2.jpg')" onMouseOut="switchback('pic3','images/photosbutton1.jpg')"><img src="images/photosbutton1.jpg" name="pic3"></a></td></tr>
<tr><td><a href="links.html" onMouseOver="switchem('pic5','images/linksbtn2.jpg')" onMouseOut="switchback('pic5','images/linksbtn1.jpg')"><img src="images/linksbtn1.jpg" name="pic5"></a></td></tr>
</table>


If anyone knows what the problem is Id really appreciate some help, thanks.

gil davis
05-25-2003, 08:39 AM
It would be more helpful to have a link to your on-line version.

Gyrogeorge
05-25-2003, 08:46 AM
Ok, its www.bigdogbmx.co.uk/frontpage.html .

khalidali63
05-25-2003, 08:49 AM
from your code it seems like your images or the linked pages do not exist in the directory on the webserver..
Mkae sure all of the paths to all of the resources do have the resource

Gyrogeorge
05-25-2003, 09:11 AM
hats what it looks like I agree but they definitely are there. Im totally confused because the exact same thing happened on a differen host with all the files inn the same directory. It DOES NOT MAKE SENSE. Ill have to go over it all again and see if I can work it out but Ill probably be crawling back here on my knees in about 15 minutes.

khalidali63
05-25-2003, 09:17 AM
can you point out in the link you posted above which images and link are not working??

Gyrogeorge
05-25-2003, 09:31 AM
The images that dont load at all are homebtn1.jpg (the top cell in the table) and articlesbtn1.jpg ( the third one down in the table i think) The links not working are news.html and articles.html. Also none of the rollovers work at all. Thanks for replying by the way, I am surprised how fast everyone on here is to help.

khalidali63
05-25-2003, 09:36 AM
if what you are saying its correct then

http://www.bigdogbmx.co.uk/images/homebtn1.jpg

should display the button...which its not.hence my point that you have resources which are not reachable,make syre there no spellingmistakes and stuff

CyCo
05-25-2003, 09:44 AM
Check to be sure you uploaded the images in binary format.

Charles
05-25-2003, 10:06 AM
If you go to http://www.bigdogbmx.co.uk/images/ you will note the existance of Homebtn1 and Homebtn2 and if you look at the source of the page you will note references to homebtn1 and homebtn2. HTTP requests are case sensitive while some OSs are not. Perhaps this is why it works locally but not on the internet.

Gyrogeorge
05-25-2003, 10:24 AM
I f***ing love you.

Gyrogeorge
05-25-2003, 10:25 AM
Sorry. I just got exited.

Gyrogeorge
05-25-2003, 10:54 AM
Thanks to the guy who told me that urls are case sensitive, I wish Id known tha about 6 months ago but never mind. The thing is the rollovers still dont work, I dont have a clue why because the code is right from what I can see, and now the links point to the right place. It says error on page at the botom when the page loads, which is no help to me.

Charles
05-25-2003, 11:15 AM
You've got your parameters out of order in your 'onmouseover' handler for that home link.

You should check out your page in Opera - it doesn't look so good - and you should consider pre-loading your images - it'll eliminate that lag.

Gyrogeorge
05-25-2003, 12:20 PM
Thanks again Charles, Ill have to look into the pre loading images thing, I skipped a lot of stuff when I learned Javascript. I dont think Ill be installing Opera though, I have little enough room on my comp as it is, plus I doubt any of the people who will use the site will have it anyway. That said, I dont see how it could look different in opera seeing as the javascript isnt effective and the rest is all basic html. I dont mean I dont believe you Im just surprised.