...

View Full Version : Simple Javascript Solution Needed



KillaH425
06-05-2006, 12:52 AM
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.

_Aerospace_Eng_
06-05-2006, 01:13 AM
I like the lightbox gallery. http://www.huddletogether.com/projects/lightbox2/

KillaH425
06-05-2006, 03:14 AM
What the ...? I need help with my current script lol.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum