Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Popup Window Size - to Match Photo Dimensions

Reply
Thread Tools

Popup Window Size - to Match Photo Dimensions

 
 
Kenny
Guest
Posts: n/a
 
      12-13-2004
The following link will take you to menu of photo galleries. If you open any
of the photo galleries you will see that each contains thumbnails. When a
thumbnail is clicked, the full-sized version of the photo is displayed in
its own popup window - AND the popup window size matches the photo size
(i.e., no white space).

What I'd like to know is to get the popup window size to match the photo
size.

http://www.amamotocross.com/gallery_...W8H90JvruXWHLs


Thanks.


 
Reply With Quote
 
 
 
 
Travis Murray
Guest
Posts: n/a
 
      12-13-2004
You need to dynamically construct your window.open() statement, passing it
height and width parameters. You can load the image into a bitmap to get
the height and width. Something like this (please excuse any syntax
errors...this is off the top of my head):

C#:
Bitmap b = new Bitmap("images/myfile.jpg");
Hyperlink1.NavigateURL = "javascript:window.open('images/myfile.jpg',
'height=" + b.Height + ",width=" + b.Width + "')";

VB:
Dim b As New Bitmap("images/myfile.jpg");
Hyperlink1.NavigateURL = "javascript:window.open('images/myfile.jpg',
'height=" + b.Height + ",width=" + b.Width + "')";

--
Travis Murray
MCSD, MCT
Artiem Consulting, Inc.
http://www.artiem.com
Learn ASP.Net In Jamaica in 2005!
Visit http://www.artiem.com/jamaica.aspx for more details.

"Kenny" <(E-Mail Removed)> wrote in message
news:%(E-Mail Removed)...
> The following link will take you to menu of photo galleries. If you open

any
> of the photo galleries you will see that each contains thumbnails. When a
> thumbnail is clicked, the full-sized version of the photo is displayed in
> its own popup window - AND the popup window size matches the photo size
> (i.e., no white space).
>
> What I'd like to know is to get the popup window size to match the photo
> size.
>
>

http://www.amamotocross.com/gallery_...W8H90JvruXWHLs
>
>
> Thanks.
>
>



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
determining javascript popup window dimensions in IE6 - onresize PradeepCBala@gmail.com Javascript 0 11-29-2007 05:32 PM
Popup Window Popup Timing =?Utf-8?B?Sm9obiBXYWxrZXI=?= ASP .Net 3 11-04-2005 07:33 PM
How to set X and Y dimensions of a custom page size on HP Laserjet 8150. Joel Computer Support 0 01-19-2005 09:05 AM
New Popup Window from an existing Popup Window Raffi Javascript 4 08-12-2004 01:21 PM
Main > Popup > Popup > Close popup AND new URL in main? Jens Peter Hansen Javascript 7 06-19-2004 08:56 PM



Advertisments