Jump to content

Pictures Click Event New Problem !!

- - - - -

  • Please log in to reply
No replies to this topic

#1
Paulo_Jorge

Paulo_Jorge

    Learning Programmer

  • Members
  • PipPipPip
  • 54 posts
Hi. I have in my website 5 pictures !! And when he click in one of them a new div is showned bellow; and another click in the picture hide the div !! This works with the 5 pics and each pic have a different div (5 pics - 5 divs) !! The problem is: to show the div 2 I have to hide the div that is showned bellow !! What I want is to replace the div also, instead to hide and show another !!

Bellow I show the the script ; the image button code and a div code !! For better understanding !!

		<script language="javascript"> 

<!--

var state = 'none';


function showhide(layer_ref) {


if (state == 'block') { 

state = 'none'; 

} 

else { 

state = 'block'; 

} 

if (document.all) { //IS IE 4 or 5 (or 6 beta) 

eval( "document.all." + layer_ref + ".style.display = state"); 

} 

if (document.layers) { //IS NETSCAPE 4 or below 

document.layers[layer_ref].display = state; 

} 

if (document.getElementById &&!document.all) { 

hza = document.getElementById(layer_ref); 

hza.style.display = state; 

} 

} 

//--> 

</script>


/*INPUT IMAGE BUTTON */


<input type="image" src="http://dl.dropbox.com/u/33652950/WEBSITE/desktop1.png" class="sombra" alt="Desktop 1" onclick="showhide('desktop1');">


/*DIV1*/


<div id="desktop1" style="display: none;" class="div_figure">


		<p><img class="img_scaled" src="http://dl.dropbox.com/u/33652950/WEBSITE/desktop1.png" alt="30 - June Desktop "></p>

		

		<p id="pf"><a id="href" href="http://paulo1471.deviantart.com/gallery/#/d3kvymg" target="_blank">30 - June Desktop</a> by <a id="href" href="http://paulo1471.deviantart.com/" target="_blank">Paulo1471</a> on <a id="href" href="http://www.deviantart.com/" target="_blank">DeviantArt</a></p>

		

		</div>




I hope for reply as soon as possible !! Please help !! Really need this !!

Thanks !!




1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users