Resizing Windows

Discussion in 'HTML' started by K, Feb 6, 2005.

  1. K

    K Guest

    I am trying to achieve the following - can anyone help?

    Before you jump on me for wanting to interfere with the user's windows -
    it's' for a corporate intranet where we can and will dictate what they see
    and how they see it.

    I have a popup which displays an image (not that it matters much I guess,
    but entire site is in ASP).

    I want the window to resize itself on opening to 'hug' the image. However,
    some images will be bigger than the screen, so I want a maximum which it
    will resize to if the image is bigger than the specified maximum.

    Also, to confuse matters - some users have varying screen-resolutions, so an
    added bonus would be to detect the users screen size and set the maximum
    resize value according to this.

    Any suggestions?

    Thanks in advance
    K, Feb 6, 2005
    #1
    1. Advertising

  2. K

    Karl Core Guest

    "K" <@.> wrote in message
    news:eek:EeNd.24973$...
    >I am trying to achieve the following - can anyone help?
    >
    > Before you jump on me for wanting to interfere with the user's windows -
    > it's' for a corporate intranet where we can and will dictate what they see
    > and how they see it.
    >
    > I have a popup which displays an image (not that it matters much I guess,
    > but entire site is in ASP).
    >
    > I want the window to resize itself on opening to 'hug' the image.
    > However,
    > some images will be bigger than the screen, so I want a maximum which it
    > will resize to if the image is bigger than the specified maximum.
    >
    > Also, to confuse matters - some users have varying screen-resolutions, so
    > an
    > added bonus would be to detect the users screen size and set the maximum
    > resize value according to this.
    >


    I'm totally ignorant of ASP, but I imagine there's some sort of equivalent
    of the PHP example I'm gonna use.

    // Begin Code
    $image="/path/to/image.gif";
    $max_width = "xxx"; // this is the max width of the window
    $max_height = "xxx"; //this is the max height of the window
    $size = getimagesize("$image"); //get the actual size of the picture in an
    array
    $width = $size[0]; // get width of picture
    $height = $size[1]; // get height of picture
    if ($width>$max_width){
    $pop_width=$max_width; // Resize if over max width
    }else {
    $pop_width=$width; // Keep original size from array because
    smaller than max

    }
    if ($height>$max_height){
    $pop_height=$max_height; // Resize if over max width
    }else {
    $pop_height=$height; // Keep original size from array
    because smaller than max

    }

    //print the popup link
    print("<a href=\"$image\" onclick=\"window.open('$image', 'popup_name_here',
    'toolbar=no, location=no, status=no, menubar=no, scrollbars=no,
    resizable=yes, width=$pop_width, height=$pop_height'); return false\">View
    Full Size</a>");

    // End Code

    Due to browser differences, you may actually want to open the window to be
    as many as 20 pixels wider than the image. Or, if you want an actual HTML
    popup, you can do that too, and just pass the variables in the query string


    --
    Karl Core
    Hell To Pay, Baltimore Hardcore: http://www.eightninethree.com
    Karl Core, Feb 6, 2005
    #2
    1. Advertising

  3. K

    K Guest

    Thank you

    However, is this possible ith javascript or client-side vbscript? I am not
    familiar with PHP at all.

    I would like to open the window which will contain an ASP page with the
    image on. It has to be this way as there is other ASP code running when the
    image opens.

    Thanks
    K, Feb 6, 2005
    #3
  4. K

    Karl Core Guest

    "K" <@.> wrote in message
    news:kFpNd.38437$...
    > Thank you
    >
    > However, is this possible ith javascript or client-side vbscript? I am
    > not
    > familiar with PHP at all.
    >
    > I would like to open the window which will contain an ASP page with the
    > image on. It has to be this way as there is other ASP code running when
    > the
    > image opens.


    First, please quote when you reply on usenet. This will help others, who
    stumble across this thread somewhere in the middle, understand that which
    you and I are discussing.

    I used PHP code only as an example. There *has* to be some sort of
    equivalent capability within ASP.
    I'm not sure if javascript or VBScript can do what I've shown. I don't know
    those languages very well. Basically, what you have to do is detect the
    size of the image and then dynamically resize the window to fit the image.

    Just because you have other ASP code running, that doesn't mean you can't do
    all this, too.


    --
    Karl Core
    Hell To Pay, Baltimore Hardcore: http://www.eightninethree.com
    Karl Core, Feb 6, 2005
    #4
  5. K

    Mark Parnell Guest

    Previously in alt.html, Karl Core <> said:

    > I'm totally ignorant of ASP, but I imagine there's some sort of equivalent
    > of the PHP example I'm gonna use.


    <snip>
    > $size = getimagesize("$image"); //get the actual size of the picture in an
    > array


    This is the only bit that I can see which doesn't have an ASP equivalent
    - ASP doesn't have a built in function for getting the dimensions of an
    image. There are a couple of add-on components that can do it though.

    ASPImage
    http://www.serverobjects.com/products.htm#aspimage

    ImageSize
    http://www.serverobjects.com/products.htm#free

    --
    Mark Parnell
    http://www.clarkecomputers.com.au
    Mark Parnell, Feb 7, 2005
    #5
  6. K

    K Guest

    "Mark Parnell" <> wrote in message
    news:1xp8zj2c00wnv$.7fk9u2xifh9s$...
    > Previously in alt.html, Karl Core <> said:
    >
    >> I'm totally ignorant of ASP, but I imagine there's some sort of
    >> equivalent
    >> of the PHP example I'm gonna use.

    >
    > <snip>
    >> $size = getimagesize("$image"); //get the actual size of the picture in
    >> an
    >> array

    >
    > This is the only bit that I can see which doesn't have an ASP equivalent
    > - ASP doesn't have a built in function for getting the dimensions of an
    > image. There are a couple of add-on components that can do it though.
    >
    > ASPImage
    > http://www.serverobjects.com/products.htm#aspimage
    >
    > ImageSize


    Thanks

    I don't have control over the web server to install custom components
    however :-(

    I need to achieve this entirely with client-side scripting - be it VB or
    Javascript.

    I will give PHP a try if all else fails, but I don't know it at all so I
    really want to avoid it.
    K, Feb 7, 2005
    #6
    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. Aaron

    resizing IE browser windows

    Aaron, Sep 30, 2004, in forum: ASP .Net
    Replies:
    3
    Views:
    513
    darrel
    Sep 30, 2004
  2. =?Utf-8?B?UGF1bA==?=

    Resizing windows-hyperlink columns datagrid

    =?Utf-8?B?UGF1bA==?=, May 18, 2005, in forum: ASP .Net
    Replies:
    0
    Views:
    471
    =?Utf-8?B?UGF1bA==?=
    May 18, 2005
  3. Chris Share

    Curses and resizing windows

    Chris Share, Jun 22, 2004, in forum: Python
    Replies:
    1
    Views:
    520
    Thomas Dickey
    Jun 22, 2004
  4. Pil (Trustworthy from Experience)

    Resizing a div by resizing its borders

    Pil (Trustworthy from Experience), Apr 18, 2009, in forum: Javascript
    Replies:
    9
    Views:
    339
    Proper
    Apr 21, 2009
  5. Proper
    Replies:
    0
    Views:
    191
    Proper
    Apr 18, 2009
Loading...

Share This Page