|
| |
|
|
99bird
Posts: 15 Joined: 3/19/2004 Status: offline
|
Image Click - 7/18/2006 18:21:46
I am using the following code from this codeave.com http://www.codeave.com/javascript/code.asp?u_log=7001 to do an image swap on click using images returned from a FP database. Everything works fine with exception I would like to click on the larger image to open a new window to show a larger image. I have tried but I am unable to get the image to open in the new window. I either get a blank page or a file not found page. It has something to do on how to call the current image. If anyone can shed any light on this, I would greatly appreciate it. Thanks in advance. <a href="javascript:;" onClick="MM_openBrWindow('document.images[large].src=image.src',' ','resizable=yes,toolbar=yes,scrollbars=yes,width=600,height=461')"><img src="<%=FP_FieldLink(fp_rs,"PhotoName1")%>" align="middle" border="0" width="40" height="44" name="large" ></a> <p> <a href="javascript:image_click(0)"> <img src="<%=FP_FieldLink(fp_rs,"PhotoName1")%>" width="30" height="34" name="pimage0" border=0></a> <a href="javascript:image_click(1)"> <img src="<%=FP_FieldLink(fp_rs,"PhotoName2")%>" width="30" height="34" name="pimage1" border=0></a> <a href="javascript:image_click(2)"> <img src="<%=FP_FieldLink(fp_rs,"PhotoName3")%>" width="30" height="34" name="pimage2" border=0></a> <a href="javascript:image_click(3)"> <img src="<%=FP_FieldLink(fp_rs,"PhotoName4")%>" width="30" height="34" name="pimage3" border=0></a> <a href="javascript:image_click(4)"> <img src="<%=FP_FieldLink(fp_rs,"PhotoName5")%>" width="30" height="34" name="pimage4" border=0></a> <a href="javascript:image_click(5)"> <img src="<%=FP_FieldLink(fp_rs,"PhotoName6")%>" width="30" height="34" name="pimage5" border=0></a> <a href="javascript:image_click(6)"> <img src="<%=FP_FieldLink(fp_rs,"PhotoName7")%>" width="30" height="34" name="pimage6" border=0></a> <a href="javascript:image_click(7)"> <img src="<%=FP_FieldLink(fp_rs,"PhotoName8")%>" width="30" height="34" name="pimage7" border=0></a> <a href="javascript:image_click(8)"> <img src="<%=FP_FieldLink(fp_rs,"PhotoName9")%>" width="30" height="34" name="pimage8" border=0></a> </center> <script language="JavaScript"><!-- //thumbnail script image0 =new Image(); image1 =new Image(); image2 =new Image(); image3 =new Image(); image4 =new Image(); image5 =new Image(); image6 =new Image(); image7 =new Image(); image8 =new Image(); // This defines the source of the display image image0.src ="<%=FP_FieldLink(fp_rs,"PhotoName1")%>" image1.src ="<%=FP_FieldLink(fp_rs,"PhotoName2")%>" image2.src ="<%=FP_FieldLink(fp_rs,"PhotoName3")%>" image3.src ="<%=FP_FieldLink(fp_rs,"PhotoName4")%>" image4.src ="<%=FP_FieldLink(fp_rs,"PhotoName5")%>" image5.src ="<%=FP_FieldLink(fp_rs,"PhotoName6")%>" image6.src ="<%=FP_FieldLink(fp_rs,"PhotoName7")%>" image7.src ="<%=FP_FieldLink(fp_rs,"PhotoName8")%>" image8.src ="<%=FP_FieldLink(fp_rs,"PhotoName9")%>" // This defines the source of the preview image document.images['pimage0'].src=image0.src; document.images['pimage1'].src=image1.src; document.images['pimage2'].src=image2.src; document.images['pimage3'].src=image3.src; document.images['pimage4'].src=image4.src; document.images['pimage5'].src=image5.src; document.images['pimage6'].src=image6.src; document.images['pimage7'].src=image7.src; document.images['pimage8'].src=image8.src; // This defines what to do when an image is clicked on function image_click(clicks) { if(clicks==0){document.images['large'].src=image0.src;} if(clicks==1){document.images['large'].src=image1.src;} if(clicks==2){document.images['large'].src=image2.src;} if(clicks==3){document.images['large'].src=image3.src;} if(clicks==4){document.images['large'].src=image4.src;} if(clicks==5){document.images['large'].src=image5.src;} if(clicks==6){document.images['large'].src=image6.src;} if(clicks==7){document.images['large'].src=image7.src;} if(clicks==8){document.images['large'].src=image8.src;} } // --></script>
|
|
|
|
rdouglass
Posts: 9280 From: Biddeford, ME USA Status: offline
|
RE: Image Click - 7/19/2006 9:08:25
quote:
f(clicks==0){document.images['large'].src=image0.src;} There must be more to this script. I can see no where is 'clicks' defined nor can I see the function 'image_click(). Are they the same? Also, the way that array is written implies (to me anyways) that all items have the same image. Is that really what you want? Do you have a URL? It may help to see a little clearer.
_____________________________
Don't take you're eye off your final destination. ASP Checkbox Function Tutorial.
|
|
|
|
99bird
Posts: 15 Joined: 3/19/2004 Status: offline
|
RE: Image Click - 7/24/2006 10:51:29
rdouglass, Thank you for your reply. Here is the url for the code. http://www.codeave.com/javascript/image_click.html What I am trying to do is to be able to click on the larger image and open up even a larger image in a new window. Thanks in advance for your help.
|
|
New Messages |
No New Messages |
Hot Topic w/ New Messages |
Hot Topic w/o New Messages |
Locked w/ New Messages |
Locked w/o New Messages |
|
Post New Thread
Reply to Message
Post New Poll
Submit Vote
Delete My Own Post
Delete My Own Thread
Rate Posts
|
|
|