www.webdeveloper.com
Results 1 to 4 of 4

Thread: Need mainphoto script

  1. #1
    Join Date
    Jul 2006
    Posts
    21

    Need mainphoto script

    Hi,

    Image A and image B are on the same page. I need to put a link on the same page that will change both image A and image B to image C with one click.

    Thanks in advance for your help as usual.

    Steve

  2. #2
    Join Date
    May 2006
    Location
    Somewhere behind your screen
    Posts
    1,633
    Code:
    ...
    <script type="text/javascript">
    function doc(id){return document.getElementById(id);}
    window.onload=function(){
    var im1=doc("image_A_id"),im2=doc("image_B_id"),imC="image_C_src",lnk=doc("the_link_id");
    lnk.onclick=function(){im1.src=im2.src=imC;}
    }
    </script>
    </head>
    <body>
    ...
    xxx: Guess Buddhist riddle: "What is the sound of one hand clapping?"
    yyy: facepalm

  3. #3
    Join Date
    Jul 2006
    Posts
    21
    Thank you!!!

  4. #4
    Join Date
    May 2006
    Location
    Somewhere behind your screen
    Posts
    1,633
    you're welcome )
    xxx: Guess Buddhist riddle: "What is the sound of one hand clapping?"
    yyy: facepalm

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