Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > HTML > Resizing Windows

Reply
Thread Tools

Resizing Windows

 
 
K
Guest
Posts: n/a
 
      02-06-2005
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


 
Reply With Quote
 
 
 
 
Karl Core
Guest
Posts: n/a
 
      02-06-2005

"K" <@.> wrote in message
newsEeNd.24973$(E-Mail Removed) k...
>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


 
Reply With Quote
 
 
 
 
K
Guest
Posts: n/a
 
      02-06-2005
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


 
Reply With Quote
 
Karl Core
Guest
Posts: n/a
 
      02-06-2005

"K" <@.> wrote in message
news:kFpNd.38437$(E-Mail Removed) ...
> 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


 
Reply With Quote
 
Mark Parnell
Guest
Posts: n/a
 
      02-07-2005
Previously in alt.html, Karl Core <(E-Mail Removed)> 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
 
Reply With Quote
 
K
Guest
Posts: n/a
 
      02-07-2005
"Mark Parnell" <(E-Mail Removed)> wrote in message
news:1xp8zj2c00wnv$.7fk9u2xifh9s$.mark@markparnell .com.au...
> Previously in alt.html, Karl Core <(E-Mail Removed)> 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.


 
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
Resizing a div by resizing its borders Pil (Trustworthy from Experience) Javascript 9 04-21-2009 07:35 AM
Resizing a div by resizing its borders Proper Javascript 0 04-18-2009 08:02 PM
Resizing windows-hyperlink columns datagrid =?Utf-8?B?UGF1bA==?= ASP .Net 0 05-18-2005 10:51 PM
resizing IE browser windows Aaron ASP .Net 3 09-30-2004 09:43 PM
Resizing of windows James Doyle Computer Support 4 11-02-2003 01:41 AM



Advertisments