SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Member
    Join Date
    Jun 2008
    Posts
    2
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    js image gallery help help

    Hi

    I'm creating a photo gallery using js and css but want to be able to highlight the corresponding thumbnail being shown with a 3px bottomborder. The gallery is based on the js image gallery at alistapart but with thumbnails instead of text links:



    js code:

    Code:
      <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>
    html:

    HTML Code:
    <div class="gallery">
    <img id="placeholder" src="photos/large/001.jpg" alt=""></img>
    <p id="desc">Imagine Retail Store</p>
    <ul>
    <li><a onclick="return showPic(this)" href="photos/large/001.jpg" title="Imagine Retail Store"><img src="photos/thumbs/001.jpg" width="68" height="53" alt="Imagine Retail Store"></img></a></li>
    <li><a onclick="return showPic(this)" href="photos/large/002.jpg" title="Imagine Retail Store"><img src="photos/thumbs/002.jpg" width="68" height="53" alt="Imagine Retail Store"></img></a></li>
    </ul><br />
    </div>

    Any help will be greatly appreciated.

    Thanks
    ath

  2. #2
    SitePoint Guru alecrust's Avatar
    Join Date
    Jun 2007
    Location
    London, UK
    Posts
    728
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    And the CSS? This is what would be used to add the bottom-border. Can't you just provide a link to the page?
    Honda Civic Forum - UK Civic Forum
    Web Host Reviews - Independent, honest host reviews
    My Portfolio - Simplicity is the ultimate sophistication

  3. #3
    SitePoint Member
    Join Date
    Jun 2008
    Posts
    2
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hi,

    Sorry forgot to paste that - I'm new here so can't post any urls sadly. but hopefully this will work if you go to alistapart(dot)com/articles/imagegallery thats the orginal

    my sample page:marathonlunatics(dot)com/gallery/


    thanks
    ath


Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •