Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    New Coder
    Join Date
    Jun 2006
    Posts
    34
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Exclamation Simple Javascript Solution Needed

    Hey,

    I am a PHP person, as it is the best easy language for web design. I need to do this image gallery though, for an online store. This is my code for the popup window:

    function goImgWin(myImage,myWidth,myHeight,origLeft,origTop) {
    myHeight += 24;
    myWidth += 24;
    TheImgWin = window.open(myImage,'image','height=' +
    myHeight + ',width=' + myWidth +
    ',toolbar=no,directories=no,location=no,status=0,menubar=no,scrollbars=no,resizable=no');
    TheImgWin.resizeTo(myWidth+2,myHeight+30);
    TheImgWin.moveTo(origLeft,origTop);
    TheImgWin.focus();
    }

    ...and this is my code for the thumbnail swap image function:

    image0 =new Image();
    image1 =new Image();


    // These 3 lines define the source of the displayed images
    image0.src =\"$item_smallpic\"
    image1.src =\"$item_smallpic2\"

    // This defines the source of the preview image
    document.images['thumb'].src=image0.src;
    document.images['thumb2'].src=image1.src;

    // This defines what to do when an image is clicked on
    function image_click(clicks)
    {
    if(clicks==0){document.images['small'].src=image0.src;}
    if(clicks==1){document.images['small'].src=image1.src;}
    }

    What I want to accomplish is when you click on the thumbnail, it changes a variable or something, so that when I retrieve it in PHP I can then change the link. This is my site, to show you what I mean: http://www.heatedcold.com Click on Merch -> T-Shirts -> Middle one. Click the thumbnails and then click the bigger image. Notice how the popup image doesn't change when you click a different thumbnail. Any help would be greatly appreciated.

  • #2
    Supreme Master coder! _Aerospace_Eng_'s Avatar
    Join Date
    Dec 2004
    Location
    In a place far, far away...
    Posts
    19,291
    Thanks
    2
    Thanked 1,043 Times in 1,019 Posts
    ||||If you are getting paid to do a job, don't ask for help on it!||||

  • #3
    New Coder
    Join Date
    Jun 2006
    Posts
    34
    Thanks
    0
    Thanked 0 Times in 0 Posts
    What the ...? I need help with my current script lol.


  •  

    Posting Permissions

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