Click to See Complete Forum and Search --> : help request
wwzausch
04-08-2003, 08:01 AM
After my post last night, I woke up at 3:45 this morning and figured out most of my problems. However, I still need help, please.
I have cleaned up my script, adding notations so it should be very easy to follow what I am doing.
script: http://www.zausch.com/thumb/zimage1_4.js
examples(basic): http://www.zausch.com/thumb/thumbsample1/thumbscript.html
examples(optional text at bottom):http://www.zausch.com/thumb/thumbsample2/project1.html
I apologize for any messy html... I did some quick copy and pasting to make these demo pages.
So, I'd like to add the ability to click on the main image (the large image) and have it open a new window with an even larger, higher-res version of the same image... similar to the script found at: http://www.abvent.com/us/gallery/ga...hup/default.asp (when you click on their thumbnails)
Problem is, when it passes a new image to "main" how can I have it pass a link as well, or even trigger a javascript that corresponds to that particular image when that image is clicked on?
Thanks in advance. I have come a long way in one morning!
Walt
Nevermore
04-08-2003, 12:33 PM
http://forums.webdeveloper.com/showthread.php?s=&threadid=4727
wwzausch
04-08-2003, 01:10 PM
Thanks, but I am confused on what you are pointing me to. The posters examples are down, and there is a bunch of dicusssion database stuff... and then there are some examples of a painting company, but that isn't really what I am trying to do.
Did I miss something?
Thanks
Walter
wwzausch
04-08-2003, 05:16 PM
what I don't know is how I can link a script (or even a simple URL) to the photos in the array that I defined in the first script. I mean, initially a simple HREF with a target = new would suffice in making a new window... but they would have to be associated with each photo .src that I have defined, I guess?
The problem is, to be able to click on the main image, I suppose the HREF for that image would have to be assigned with the image in the script, as it defines the variables in the array (loop, whatever), so that when the image appears in the "main" image cell, it's HREF link goes with it...
Understand my dilemma?
I thought about something like this, written in plain English (because I don't know the syntax of what I am trying to do) I have put my new concept After ADDED: if you can't, with the notes of my original script, above.
MY IDEA:
// This is a loop that creates 12 new image objects and
// defines their src for main images.
ADDED: // This is a loop that creates 12 new links for the main images..
// This is a loop that instantiates 12 new image objects and
// defines their src for main image captions.
// This is a loop that instantiates 2 new image objects and
// defines their src for optional text descriptions.
// Preloading: This function is preloading the main images to the
// browser's cache when the page loads.
// Preloading: This function is preloading the optional text images to the
// browser's cache when the page loads.
// This is the function being called from the <a href> tag.
// It is passing this function a variable that gets names "thumbs".
// If this function is passed a number it will change the images named
// large ADDED: WITH ITS URL and caption in the HTML document. Example: <a href="javascript:thumbtobig(1)">
// changes the large image to thumb.src ADDED: WITH ITS URL and caption to cap1.src listed above.
function thumbtobig(thumbs)
{
if(thumbs==1){document.images['large'].src=thumb1.src (IMAGE 1) ;document.images['caption'].src=cap1.src (WITH CAPTION 1); ADDED: A HREF FOR NEW POP-UP WINDOW, HIGH RES IMAGE 1 (WITH LINK 1)}
if(thumbs==2){document.images['large'].src=thumb2.src;document.images['caption'].src=cap2.src; ADDED: A HREF FOR NEW POP-UP WINDOW, HIGH RES IMAGE 2}
if(thumbs==3){document.images['large'].src=thumb3.src;document.images['caption'].src=cap3.src; ADDED: A HREF FOR NEW POP-UP WINDOW, HIGH RES IMAGE 3}
Something like that.
I suppose you could also (maybe) attach the A HREF to the photo when you define it in the first loop, above?
So it say somthing like this:
// This is a loop that creates 12 new image objects,
// and defines their src for main images and their corresponding HREF, Target=new tags.
I'm not sure I am making myself clear on this, but I hope that helps. I have no idea how to write the syntax for something like this.
Walt