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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.