Jump to content

[SOLVED] Image gallery problem


laPistola

Recommended Posts

i taken this script from http://www.alistapart.com/articles/imagegallery

which when i try it it dont work, when you click the link it reloads a new page only containing the picture?

 

whatis should do is replace a current large picture with another already on the page.

 

my scripts

 

<script type="text/javascript" language="javascript">
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;
}
}
</script>

 

the code its using is

 

<img id="placeholder" src="images/1.jpg" alt="" width="350" />
<p id="desc" class="style2">Click on an images to enlarge</p>

 

and the links look like

 

<a href="1.jpg" title="Click on an images to enlarge" onclick="return showPic(this)"><img src="1.jpg" width="75" /></a>

 

i dont really what the title and desc bits so removed them but put hem back in when the script didnt work.

 

i guess its just returning true but any ideas to why its not working??

 

Thank you

Link to comment
https://forums.phpfreaks.com/topic/163433-solved-image-gallery-problem/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.