Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > HTML > Window size without javascript

Reply
Thread Tools

Window size without javascript

 
 
Helpful person
Guest
Posts: n/a
 
      05-19-2009
I have created a link. This leads to a page that has only an image.
Is there a way I can set the window size to be equal to the image
without using javascript?

Thanks
 
Reply With Quote
 
 
 
 
Helpful person
Guest
Posts: n/a
 
      05-19-2009
On May 19, 3:41*pm, Helpful person <(E-Mail Removed)> wrote:
> I have created a link. *This leads to a page that has only an image.
> Is there a way I can set the window size to be equal to the image
> without using javascript?
>
> Thanks


I forgot to mention that I know the size of the image, so the width
and height can be hard coded.
 
Reply With Quote
 
 
 
 
Gus Richter
Guest
Posts: n/a
 
      05-19-2009
Helpful person wrote:
> On May 19, 3:41 pm, Helpful person <(E-Mail Removed)> wrote:
>> I have created a link. This leads to a page that has only an image.
>> Is there a way I can set the window size to be equal to the image
>> without using javascript?
>>
>> Thanks

>
> I forgot to mention that I know the size of the image, so the width
> and height can be hard coded.



Instead of thinking to set the window size to the size of the image,
which I think is impossible for all conditions IMHO, try to set the
image to the window size.

<img src="image.png" style="width: 100%;">

--
Gus

 
Reply With Quote
 
Helpful person
Guest
Posts: n/a
 
      05-19-2009
On May 19, 4:14*pm, Gus Richter <(E-Mail Removed)> wrote:
> Helpful person wrote:
> > On May 19, 3:41 pm, Helpful person <(E-Mail Removed)> wrote:
> >> I have created a link. *This leads to a page that has only an image.
> >> Is there a way I can set the window size to be equal to the image
> >> without using javascript?

>
> >> Thanks

>
> > I forgot to mention that I know the size of the image, so the width
> > and height can be hard coded.

>
> Instead of thinking to set the window size to the size of the image,
> which I think is impossible for all conditions IMHO, try to set the
> image to the window size.
>
> * * <img src="image.png" style="width: 100%;">
>
> --
> Gus


Thanks, but some of my images are fairly small and would look very
poor for large window sizes.
 
Reply With Quote
 
Ari Heino
Guest
Posts: n/a
 
      05-19-2009
Helpful person kirjoitti seuraavasti:

> Thanks, but some of my images are fairly small and would look very
> poor for large window sizes.


You could then use <img src="image.png" style="max-width: 100%;">
although this doesn't work in older IEs at least.

--
Ari
http://users.utu.fi/athein/
 
Reply With Quote
 
Raymond Schmit
Guest
Posts: n/a
 
      05-19-2009
On Tue, 19 May 2009 15:05:58 -0700 (PDT), Helpful person
<(E-Mail Removed)> wrote:

>On May 19, 4:14*pm, Gus Richter <(E-Mail Removed)> wrote:
>> Helpful person wrote:
>> > On May 19, 3:41 pm, Helpful person <(E-Mail Removed)> wrote:
>> >> I have created a link. *This leads to a page that has only an image.
>> >> Is there a way I can set the window size to be equal to the image
>> >> without using javascript?

>>
>> >> Thanks

>>
>> > I forgot to mention that I know the size of the image, so the width
>> > and height can be hard coded.

>>
>> Instead of thinking to set the window size to the size of the image,
>> which I think is impossible for all conditions IMHO, try to set the
>> image to the window size.
>>
>> * * <img src="image.png" style="width: 100%;">
>>
>> --
>> Gus

>
>Thanks, but some of my images are fairly small and would look very
>poor for large window sizes.


So you found the answer you where looking for .....
Don't try to impose the window size ... let the end-user do what he
want.
 
Reply With Quote
 
dorayme
Guest
Posts: n/a
 
      05-19-2009
In article <guv3v2$r69$(E-Mail Removed)-september.org>,
Gus Richter <(E-Mail Removed)> wrote:

> Helpful person wrote:
> > On May 19, 3:41 pm, Helpful person <(E-Mail Removed)> wrote:
> >> I have created a link. This leads to a page that has only an image.
> >> Is there a way I can set the window size to be equal to the image
> >> without using javascript?
> >>
> >> Thanks

> >
> > I forgot to mention that I know the size of the image, so the width
> > and height can be hard coded.

>
>
> Instead of thinking to set the window size to the size of the image,
> which I think is impossible for all conditions IMHO, try to set the
> image to the window size.
>
> <img src="image.png" style="width: 100%;">


The OP, on average, would be unlikely to be wanting the distortion that
comes with this. And besides, he would need to set height 100% to
satisfy his window size criterion. Though there are complications re
aspect ratio across browsers. In Opera, if you leave out height, it
supplies 100% mostly! At a crucial calculation point of window width it
decides not to supply the height - nor probably the width (as if some
penny drops for it and it realises it is being had and decides not to
mess about and so it then supplies the natural aspect ratio).

I came across an old picture that lent itself somewhat naturally to the
distortions of being stretched:

http://dorayme.890m.com/cacheTest/test1.html

Astute observers might be able to guess the natural aspect, and Upsdale
will, of course, be able to guess straight away the absolute natural
dimensions. I am wearing the helmet photographed. One day, btw, a few
years ago, this helmet decided to display all the things it had seen, it
was bored not being used, you see and made like an autonomous free to
air TV. It began to haunt me so I threw the damn thing out.

--
dorayme
 
Reply With Quote
 
Gus Richter
Guest
Posts: n/a
 
      05-19-2009
dorayme wrote:
> In article <guv3v2$r69$(E-Mail Removed)-september.org>,
> Gus Richter <(E-Mail Removed)> wrote:
>
>> Helpful person wrote:
>>> On May 19, 3:41 pm, Helpful person <(E-Mail Removed)> wrote:
>>>> I have created a link. This leads to a page that has only an image.
>>>> Is there a way I can set the window size to be equal to the image
>>>> without using javascript?
>>>>
>>>> Thanks
>>> I forgot to mention that I know the size of the image, so the width
>>> and height can be hard coded.

>>
>> Instead of thinking to set the window size to the size of the image,
>> which I think is impossible for all conditions IMHO, try to set the
>> image to the window size.
>>
>> <img src="image.png" style="width: 100%;">

>
> The OP, on average, would be unlikely to be wanting the distortion that
> comes with this. And besides, he would need to set height 100% to
> satisfy his window size criterion. Though there are complications re
> aspect ratio across browsers. In Opera, if you leave out height, it
> supplies 100% mostly! At a crucial calculation point of window width it
> decides not to supply the height - nor probably the width (as if some
> penny drops for it and it realises it is being had and decides not to
> mess about and so it then supplies the natural aspect ratio).


I, myself would not consider the OP's route and requirements. I simply
made a suggestion based on the OP's requirements. If other criteria is
to be introduced into the mix, so be it; other mods required.

I'm not into photography, but have noted that some photographers go to
lengths to have distortions on purpose (aspect ratio adjustments?). That
being said, it all depends on the photo and inherent size used IMHO.
I've seen a post (which I copied and have saved somewhere) explaining a
way to provide width:100% and an aspect ratio of height/width=2/3 and if
of interest, would be willing to go look for it.

> I came across an old picture that lent itself somewhat naturally to the
> distortions of being stretched:
>
> http://dorayme.890m.com/cacheTest/test1.html
>
> Astute observers might be able to guess the natural aspect, and Upsdale
> will, of course, be able to guess straight away the absolute natural
> dimensions.


I'm not a photography buff (so my opinion on this may not matter), but
to me your photo looked ok here. Stretched out a bit, but could be on
purpose to get effect, dunno.

No need to guess. Looking at the image, it says that the inherent
dimensions are 564x752px.

> I am wearing the helmet photographed. One day, btw, a few
> years ago, this helmet decided to display all the things it had seen, it
> was bored not being used, you see and made like an autonomous free to
> air TV. It began to haunt me so I threw the damn thing out.


So I assume that you kept the bike. What make is it if I may ask?

--
Gus

 
Reply With Quote
 
Gus Richter
Guest
Posts: n/a
 
      05-19-2009
Helpful person wrote:
> On May 19, 4:14 pm, Gus Richter <(E-Mail Removed)> wrote:
>> Helpful person wrote:
>>> On May 19, 3:41 pm, Helpful person <(E-Mail Removed)> wrote:
>>>> I have created a link. This leads to a page that has only an image.
>>>> Is there a way I can set the window size to be equal to the image
>>>> without using javascript?
>>>> Thanks
>>> I forgot to mention that I know the size of the image, so the width
>>> and height can be hard coded.

>> Instead of thinking to set the window size to the size of the image,
>> which I think is impossible for all conditions IMHO, try to set the
>> image to the window size.
>>
>> <img src="image.png" style="width: 100%;">
>>
>> --
>> Gus

>
> Thanks, but some of my images are fairly small and would look very
> poor for large window sizes.



I've re-read your requirement again and find that I've had another
senior moment and misunderstood, so here is to my new understanding:

When you open another window, the new window can only be resized with a
script, AFAIK.

I have my browser(s) set to open a new tab instead of a new window and I
don't know how, or if, that would affect a script. A javascript
newsgroup would be the proper venue.



--
Gus
 
Reply With Quote
 
Helpful person
Guest
Posts: n/a
 
      05-20-2009
On May 19, 6:05*pm, Helpful person <(E-Mail Removed)> wrote:
> On May 19, 4:14*pm, Gus Richter <(E-Mail Removed)> wrote:
>
>
>
>
>
> > Helpful person wrote:
> > > On May 19, 3:41 pm, Helpful person <(E-Mail Removed)> wrote:
> > >> I have created a link. *This leads to a page that has only an image.
> > >> Is there a way I can set the window size to be equal to the image
> > >> without using javascript?

>
> > >> Thanks

>
> > > I forgot to mention that I know the size of the image, so the width
> > > and height can be hard coded.

>
> > Instead of thinking to set the window size to the size of the image,
> > which I think is impossible for all conditions IMHO, try to set the
> > image to the window size.

>
> > * * <img src="image.png" style="width: 100%;">

>
> > --
> > Gus

>
> Thanks, but some of my images are fairly small and would look very
> poor for large window sizes.- Hide quoted text -
>
> - Show quoted text -


Thanks for the answers. Looks like it can't be down with HTML / CSS
alone.
 
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
Set table height to minum of the size of the "window" without javascript? J.O. Aho HTML 8 01-13-2007 06:15 AM
mega pixels, file size, image size, and print size - Adobe Evangelists Frank ess Digital Photography 0 11-14-2006 05:08 PM
Opening a new browser window to a specific size without the menu bar and address window. UJ ASP .Net 2 06-27-2005 08:21 PM
open a new window without javascript and without hyperlink Dan ASP .Net 8 11-24-2004 08:10 AM
Open window full size without javascript Mark Javascript 6 11-10-2004 04:52 AM



Advertisments