simmonet
10-09-2003, 08:21 AM
I need to be able to specify an image swap on the click of a link
No problem there, tough there are a variety of way to do it - I chose to pass the variable in the URL
javascript:imagetoswap.src='pathto/someimage.jpg'
I need to have the image that is swapped clickable to popup a larger image
Right now the larger image is named the same as the smaller image with the prefix of b-
So ideally what I need is the ability to specify the first (small) image name variable and have the image src of the larger image calculated (add the prefix) and (ideally) dynamically inserted into the popup that is generated
that can be divided into two sections -
First calculate the new image name *or* define the image name in the original link (more work!)
Second - create the pop up and write the image src info (also the popup needs to have a 'close' text link - thi could be an existing hardcoded html page that one then specifies the .src of a dummy image or written 'on the fly'
All popups are one size - though would it be nice to have them resize to the image :-)
These sections are where I am having problems finding the easiest solution.
As for deployment, would prefer to use as an external .js file and because it deals with over 250 images (plus >250 of their enlargements) I wouldn't want to have to type all of them in more than once (not too worried about preloading and as there can potentially be more than 40 on one page it's not recommended)
All and any help appreciated, and if necessary this could be a consulting (paying) gig for the right (and bullet proof) solution.
TIA
Grant
No problem there, tough there are a variety of way to do it - I chose to pass the variable in the URL
javascript:imagetoswap.src='pathto/someimage.jpg'
I need to have the image that is swapped clickable to popup a larger image
Right now the larger image is named the same as the smaller image with the prefix of b-
So ideally what I need is the ability to specify the first (small) image name variable and have the image src of the larger image calculated (add the prefix) and (ideally) dynamically inserted into the popup that is generated
that can be divided into two sections -
First calculate the new image name *or* define the image name in the original link (more work!)
Second - create the pop up and write the image src info (also the popup needs to have a 'close' text link - thi could be an existing hardcoded html page that one then specifies the .src of a dummy image or written 'on the fly'
All popups are one size - though would it be nice to have them resize to the image :-)
These sections are where I am having problems finding the easiest solution.
As for deployment, would prefer to use as an external .js file and because it deals with over 250 images (plus >250 of their enlargements) I wouldn't want to have to type all of them in more than once (not too worried about preloading and as there can potentially be more than 40 on one page it's not recommended)
All and any help appreciated, and if necessary this could be a consulting (paying) gig for the right (and bullet proof) solution.
TIA
Grant