Popup Window Size - to Match Photo Dimensions

Discussion in 'ASP .Net' started by Kenny, Dec 13, 2004.

  1. Kenny

    Kenny Guest

    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_archive.php?UID=LvFmihBrOMkKpXpqW8H90JvruXWHLs


    Thanks.
    Kenny, Dec 13, 2004
    #1
    1. Advertising

  2. 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" <> wrote in message
    news:%...
    > 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_archive.php?UID=LvFmihBrOMkKpXpqW8H90JvruXWHLs
    >
    >
    > Thanks.
    >
    >
    Travis Murray, Dec 13, 2004
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. RC
    Replies:
    2
    Views:
    455
    John M Deal
    Nov 24, 2004
  2. Pretty In Pink

    mouseover photo popup

    Pretty In Pink, Aug 16, 2003, in forum: Javascript
    Replies:
    0
    Views:
    75
    Pretty In Pink
    Aug 16, 2003
  3. Jens Peter Hansen
    Replies:
    7
    Views:
    497
    Randy Webb
    Jun 19, 2004
  4. Raffi
    Replies:
    4
    Views:
    201
    Dr John Stockton
    Aug 12, 2004
  5. Replies:
    0
    Views:
    85
Loading...

Share This Page