Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New Coder
    Join Date
    Jun 2007
    Location
    Netherlands, Den Bosch
    Posts
    14
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Exclamation Problem with images rollovers after changing the images.

    Eya everyone,

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

    Code:
    <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.
    Code:
    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:
    Code:
    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 and push the - button in the top right corner of one of the windows.

    Thx in advance!

    Marth

  • #2
    New Coder
    Join Date
    Jun 2007
    Location
    Netherlands, Den Bosch
    Posts
    14
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Allready fixed the problem.. Anyone knows how to delete threads ?


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •