www.webdeveloper.com
Results 1 to 3 of 3

Thread: can't find error in onClick code

Hybrid View

  1. #1
    Join Date
    Sep 2006
    Location
    new york
    Posts
    267

    can't find error in onClick code

    Please see http://www.lapearldesigns.com/legacy/index.html

    Code:
    <div id="showpics">
    	  <div id="space">
          <img src="coin-B.gif" name="holder" id="holder"   width="476" height="476">
          </div>	  <!--closeSPACE-->
    	  
          <div id="thumbnails"><br clear="all">
          
          <img  src="coin-B.gif"    alt="Bronze Legacy Coin" name="Bronze Coin" title="Bronze Legacy Coin"
         onClick="document.holder.src='2upB.gif'"  	onMouseOver="document.holder.src='coin-B.gif'"> 
              
              <img  src="coinC.gif"    alt="Copper Legacy Coin" name="Copper Coin" title="Copper Legacy Coin"
         onClick="document.holder.src='2upC.gif'"  	onMouseOver="document.holder.src='coinC.gif'"> 
             <img  src="coin-N.gif"    alt="Nickel Legacy Coin" name="Nickel Coin" title="Nickel Legacy Coin"
         onClick="document.holder.src='2upN.gif'"  	onMouseOver="document.holder.src='coin-N.gif'"> 
    </div> <!--closeTHUMBNAILS-->
    	  <br clear="all">
        </div><!--closeSHOWPICS-->
    Can someone see what's wrong/

  2. #2
    Join Date
    Mar 2011
    Posts
    1,159
    Replace all instances of:
    document.holder.src

    With:
    document.getElementById('holder').src

  3. #3
    Join Date
    Sep 2006
    Location
    new york
    Posts
    267
    Thanks Rick, but I don't see what that would do?

    I should explain, I'm helping DLC set up a new site. We're still working on it. So far this Legacy page has animated GIF versions (the 2up files) that show front/back of the coins for onClick code. The 3 onMouseOver work, but just the first onClick one works. The last two do not show the animated GIFs onClick.

    We tried double-checking that the files were saved to the correct folder and that the paths to the images were correct. I eyeballed the code over and over again but could not see error. It's so easy to go blind to the obvious.

    Now I'm thinking, we should upload the 2Ups as thumbnails just to check that the GIF animations still work.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

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



Recent Articles