![]() |
|
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Newbie
Join Date: Jun 2005
Posts: 29
Rep Power: 0
![]() |
ASP Popup Window
Hi all, this is what i would like to do. I have an original page,showing many small images. But i would like the user to be able to click on it and a popup window will appear,showing an enlarged image. How do i do that?
I know firstly i will need to generate a pop up window by using that window.opener something,could some one help? Also,i have stored both the small images and the enlarged images in my database so how do write the code for the popup window to show the respective enlarged images when i click on each of their small image? Please help!!! Thanks... |
|
|
|
|
|
#2 |
|
Hobbyist Programmer
Join Date: Nov 2005
Posts: 122
Rep Power: 3
![]() |
You need JavaScript for that...
Yould make an image 'container' page in asp that takes in a parameter from the url that tells it which image to load. Dim image
image=Request.QueryString('img')
Response.Write("<img src='"&image&"' alt='Big Image' />")To open the page you just need something like: <a href="image.asp?img=path_to_pic.gif" onclick="return !window.open(this.href, 'image_window', 'width=400,height=400');"> <img src="path_to_thumbnail.gif" alt="Thumbnail" style="border-style:none;" /> </a> HTH, --47.
__________________
"I'm going to become rich and famous when I invent a device that allows you to stab people in the face over the internet" |
|
|
|
|
|
#3 |
|
Newbie
Join Date: Jun 2005
Posts: 29
Rep Power: 0
![]() |
thanks,but where do u get the variable 'image_window' from?? and also,what does this.href mean . ? sorry i'm kinda lousy at programming stuff =(
and oh yes,that part about the 'path_to_pic' and 'path_to_thumbnail'.. what does that mean? it's not a specific path like 'pic1.gif' right? because i want each pic to load when i click on each of the respective thumbnails and not just a specific one.. =x Currently this is what my code looks like: <tr> <td rowspan=4 width=100><img src="<%=RS("WholeCakesSImage").value%>"></a> </td> so how do i put in the a href so that when i click on their respective thumbnails,their enlarged image will appear in a pop up? also .... i understand that here the popup box's name is image.asp. so what exactly am i supposed to code inside that page?? Edit: So sorry for that so many questions... i've tried out your code and i've got the popup box already,just that when i click on it (the thumbnail),the popup box appears with nothing.As in,just a plain white popup box. How do i pass in the enlarged image in there? Last edited by raikkonen; Nov 7th, 2005 at 7:49 PM. |
|
|
|
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|