javascript - How to change an image selected from another window -


i have got code change image image list of then. i'm trying show new window image list choose one.

<div class="row">     <div class="service-icon">             <img style='margin:0; padding:0; border:0;' id="imggaleria" onclick="imgseleccionada='imggaleria';" src="img/modulo1.jpg" />             <img style='margin:0; padding:0; border:0;' id="imggaleria2" onclick="imgseleccionada='imggaleria2';" src="img/modulo2.jpg" />             <img style='margin:0; padding:0; border:0;' id="imggaleria3" onclick="imgseleccionada='imggaleria3';"  src="img/modulo3.jpg" />              <div id="galeria_miniaturas">                 <img class="miniatura" onclick="javascript:document.getelementbyid(imgseleccionada).src='img/modulo5.jpg';" src="img/modulo5.jpg" />                 <img class="miniatura" onclick="javascript:document.getelementbyid(imgseleccionada).src='img/modulo6.jpg';" src="img/modulo6.jpg" />                 <img class="miniatura" onclick="javascript:document.getelementbyid(imgseleccionada).src='img/modulo7.jpg';" src="img/modulo7.jpg" />                 <img class="miniatura" onclick="javascript:document.getelementbyid(imgseleccionada).src='img/modulo8.jpg';" src="img/modulo8.jpg" />                 <img class="miniatura" onclick="javascript:document.getelementbyid(imgseleccionada).src='img/modulo9.jpg';" src="img/modulo9.jpg" />                 <img class="miniatura" onclick="javascript:document.getelementbyid(imgseleccionada).src='img/modulo10.jpg';" src="img/modulo10.jpg" />                 <img class="miniatura" onclick="javascript:document.getelementbyid(imgseleccionada).src='img/modulo11.jpg';" src="img/modulo11.jpg" />                 <img class="miniatura" onclick="javascript:document.getelementbyid(imgseleccionada).src='img/modulo12.jpg';" src="img/modulo12.jpg" />                 <img class="miniatura" onclick="javascript:document.getelementbyid(imgseleccionada).src='img/modulo13.jpg';" src="img/modulo13.jpg" />             </div>         </div>     </div> 

  1. you not have image id imgseleccionada added 1 there no need set id on click on 1 image,

<div class="row">      <div class="service-icon">              <img style='margin:0; padding:0; border:0;' id="imgseleccionada" src="img/modulo1.jpg" />              <div id="galeria_miniaturas">                  <img class="miniatura" onclick="javascript:document.getelementbyid('imgseleccionada').src='img/modulo5.jpg';" src="img/modulo5.jpg" />                  <img class="miniatura" onclick="javascript:document.getelementbyid('imgseleccionada').src='img/modulo6.jpg';" src="img/modulo6.jpg" />                  <img class="miniatura" onclick="javascript:document.getelementbyid('imgseleccionada').src='img/modulo7.jpg';" src="img/modulo7.jpg" />                  <img class="miniatura" onclick="javascript:document.getelementbyid('imgseleccionada').src='img/modulo8.jpg';" src="img/modulo8.jpg" />                  <img class="miniatura" onclick="javascript:document.getelementbyid('imgseleccionada').src='img/modulo9.jpg';" src="img/modulo9.jpg" />                  <img class="miniatura" onclick="javascript:document.getelementbyid('imgseleccionada').src='img/modulo10.jpg';" src="img/modulo10.jpg" />                  <img class="miniatura" onclick="javascript:document.getelementbyid('imgseleccionada').src='img/modulo11.jpg';" src="img/modulo11.jpg" />                  <img class="miniatura" onclick="javascript:document.getelementbyid('imgseleccionada').src='img/modulo12.jpg';" src="img/modulo12.jpg" />                  <img class="miniatura" onclick="javascript:document.getelementbyid('imgseleccionada').src='img/modulo13.jpg';" src="img/modulo13.jpg" />              </div>          </div>  </div>

try above code fiddle


Comments

Popular posts from this blog

python - Healpy: From Data to Healpix map -

c - Bitwise operation with (signed) enum value -

xslt - Unnest parent nodes by child node -