»
EnglishFrenchVietnamese

Print - Simple Picture Gallery - JavaScriptBank.com

Full version: jsB@nk » Image » Image viewer » Simple Picture Gallery
URL: https://www.javascriptbank.com/simple-picture-gallery.html

Simple Picture Gallery © JavaScriptBank.comDisplay a gallery of images with titles and descriptions for each image. Easy to set up and completely customizable.

Full version: jsB@nk » Image » Image viewer » Simple Picture Gallery
URL: https://www.javascriptbank.com/simple-picture-gallery.html



CSS
<style type="text/css">.jsbank_sample_cont {margin: 20px; padding: 20px;}.jsbank_sample_tit {font-weight: bold; margin-bottom: 10px; padding: 5px; width: auto; background-color: #c0c0c0; border: 5px solid #a0a0a0; color: black; text-align: center;}img {  border: none;}a {  outline: none;}li {  display:inline;}#desc {  font-style: italic;}</style>


JavaScript
<script type="text/javascript">// Created by: Jeremy Keith / Anonymous | http://www.alistapart.com/articles/imagegallery/function showPic(whichpic) {  if (document.getElementById) {    document.getElementById('placeholder').src = whichpic.href;    if (whichpic.title) {      document.getElementById('desc').childNodes[0].nodeValue = whichpic.title;    } else {      document.getElementById('desc').childNodes[0].nodeValue = whichpic.childNodes[0].nodeValue;    }    return false;  } else {  return true;  }}var previousToggle=null;function toggleMe(a){  var e=document.getElementById(a);  if(!e)return true;  if(e.style.display=="none"){    e.style.display="block";    if(previousToggle)previousToggle.style.display="none";    previousToggle=e;  }  return true;}</script>


HTML
<!--  Place the name (and path, if necessary) of the regular size images in the 'href' attribute. Do not give the size of this image. Place the name (and path, if necessary) of the smaller size images in the 'src' attribute. Place the descriptions in the 'title' attribute. Be sure to change the number of each paragraph, e.g., 'para1', 'para2', to match the image below.  --><ul>  <li><a onclick="toggleMe('para1'); showPic(this); return false;" href="pix1.jpg" title="Ma quande lingues coalesce, li grammatica del resultant lingue es plu simplic e regulari quam ti del coalescent lingues. Li nov lingua franca va esser plu simplic e regulari quam li existent Europan lingues."><img src="pix1-smaller.gif" width="50" height="38"></a></li>  <li><a onclick="toggleMe('para2'); showPic(this); return false;" href="pix2.jpg" title="Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat."><img src="pix2-smaller.gif" width="50" height="38"></a></li>  <li><a onclick="toggleMe('para3'); showPic(this); return false;" href="pix3.jpg" title="It va esser tam simplic quam Occidental: in fact, it va esser Occidental. A un Angleso it va semblar un simplificat Angles, quam un skeptic Cambridge amico dit me que Occidental es."><img src="pix3-smaller.gif" width="50" height="38"></a></li></ul><div style="width: 400px; padding: 10px;"><!--  Place the title of each image here.  --><div id="para1" style="display:none; font-size: 1.2em; font-weight: 800;">The Majestic Mountains</div><div id="para2" style="display:none; font-size: 1.2em; font-weight: 800;">The Spacious Lake</div><div id="para3" style="display:none; font-size: 1.2em; font-weight: 800;">The Lonely, Barren Tree</div><!--  Place the name of any image you want to initially display here. Do not give the size of this image.  --><img id="placeholder" src="blank.gif"><div id="DivContent"></div><div id="desc">Choose an image to begin</div></div><!--  If you want the smaller images to display at the bottom, place the images in the list above (with the 'onclick' events) here.  -->


Files
/javascript/image/Simple_Picture_Gallery/Simple_Picture_Gallery_images.zip