View Full Version : Problem with images rollovers after changing the images.

07-06-2007, 05:02 PM
Eya everyone,

I was adding some rollovers to my site but I encountered a problem when trying to add it to the following image:

<a href=\"#\" onClick=\"Switch(".$id.") ; return false;\" onMouseover=\"highlight('thmin".$id."', 'img_th_min_hover');\" onMouseout=\"highlight('thmin".$id."', 'img_th_min');\"><img id=\"pic".$id."\" src=\"images/th_min.png\" name=\"thmin".$id."\"></a>

this is a button which switches the display property of a div onclick but it also changes the image itself into a + rather then a -. Therefor the highlight needs to use plus_hover rather then minus_hover.

Here are the switch and highlight functions:

Switch -- This function switches the display and the +/- image.

function Switch(id)
var klappText = document.getElementById('s' + id);
var klappBild = document.getElementById('pic' + id);

if (klappText.style.display == 'none') {
klappText.style.display = '';
klappBild.src = 'images/th_min.png';
else {
klappText.style.display = 'none';
klappBild.src = 'images/th_max.png';

Highlight -- this function highlights several images preloaded onload:

function highlight(picName,imgName)
imgOn=eval(imgName + ".src");
document[picName].src= imgOn;

To get a better idea of what the problem exactly is pls take a look here (http://marfee.freehostia.com/surf/) and push the - button in the top right corner of one of the windows.

Thx in advance!


07-07-2007, 03:43 PM
Allready fixed the problem.. Anyone knows how to delete threads ?

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum