SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Member
    Join Date
    Jun 2005
    0 Post(s)
    0 Thread(s)

    Exclamation Javascript Gallery not working right on IE

    Hi everyone,

    I wanted to use this gallery system explained over at A List Apart, located here. The gallery works perfect under Firefox, however, it does not work right with IE-7. The problem is that every time you click a thumbnail/link to open in the "placeholder", it opens in a page on it's own.

    In firefox however, the images just change in place of "placeholder" without going to a different page.

    this is the code that I'm working with,

    HTML Code:
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "">
    <html xmlns="">
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
    <title>Javascript Gallery</title>
    	<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; 
    		<li><a onclick="return showPic(this)"  href="01.jpg" title="Picture One">Picture One</a></li>
    		<li><a onclick="return showPic(this)"  href="02.jpg" title="Picture Two">Picture Two</a></li>
    		<li><a onclick="return showPic(this)"  href="03.jpg" title="Picture Three">Picture Three</a></li>
    	<img src="01.jpg" border="0" id="placeholder" />
    	<p id="desc">Choose an image to begin</p>
    Any kind of help would be appreciated.

  2. #2
    SitePoint Addict ALL's Avatar
    Join Date
    Oct 2005
    South Dakota
    1 Post(s)
    0 Thread(s)
    well i dont see anything wrong with the code... if i had to take a guess... you have javascript off in IE7. I tested it in IE7 and it worked just fine. if you give us a testable place i could better examin it... but it looks fine and dandy here

    Did I help you?
    You can repay me, support one of my projects (no money needed):
    JavaScript Wiki, Another Web Forum, Paranormal Site


Posting Permissions

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