0

Here is my webpage: http://www.lightsforafrica.org/project.html

HOVERPICS.

It used to work but, even though I've changed nothing, it no longer works!

When you hover your mouse over the 5 words: America, Asia, Europe, India and Africa (towards the foot of the page) the image with the lights used to change to that region.

I'm using this code:
<SCRIPT type="text/javascript">
<!--
var hoverTrg11=document.getElementById("hoverArea11");
var hoverImg2=document.getElementById("hoverPic2");
hoverTrg11.onmouseover=function(){
hoverImg2.src="Images/lights_america.jpg";
}


<td><img id="hoverArea11" src="Images/America.gif" alt="" width="130" height="39" /></td>

This seems to have happened on all my website (which all previously worked).

Any ideas?

4
Contributors
9
Replies
10
Views
6 Years
Discussion Span
Last Post by tinymark
0

Why not instead of using javascript for hover images, use css? It might free some resources from the explorer viewing your site.

you can check CSS hovers here

0

Thanks for the advice. But so you know why my code (which always worked) has just stopped working?

0

Works fine for me... maybe the explorer you are using? Or a javascript deactivator, or activex control blocking?

Attachments Hover.png 20.19 KB
0

Well that's good to hear. It used to work for me on IE, firefox and chrome. This morning I had an email from a visitor saying it wasn't working. I checked and she was right. Now I've checked again and it's working in all 3 browsers. Very strange!

Should probably switch to css from java!

0

This might pose a problem, as you've already seen, for visitors who have js disabled. I normally do disable it except for testing environments.

As Nichito suggested, this can also be done with hidden divs and CSS, which will work in all browsers with no js at all. You should definately look into that.

0

I tried it as well with lots of different browsers and Operating systems. They all work fine. There are far too many things that could be wrong that have nothing to do with your design.

After I have checked my code, I suspect the server delivering my files is the problem. I know what my hosting service provides as features and I stay up-to-date with what versions of the programs they are using. A change in version of a program you were using could be the cause. I'm pretty quick with an email to tech support when this happens.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.