Window size without javascript

Discussion in 'HTML' started by Helpful person, May 19, 2009.

  1. 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
     
    Helpful person, May 19, 2009
    #1
    1. Advertising

  2. On May 19, 3:41 pm, Helpful person <> 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.
     
    Helpful person, May 19, 2009
    #2
    1. Advertising

  3. Helpful person

    Gus Richter Guest

    Helpful person wrote:
    > On May 19, 3:41 pm, Helpful person <> 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
     
    Gus Richter, May 19, 2009
    #3
  4. On May 19, 4:14 pm, Gus Richter <> wrote:
    > Helpful person wrote:
    > > On May 19, 3:41 pm, Helpful person <> 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.
     
    Helpful person, May 19, 2009
    #4
  5. Helpful person

    Ari Heino Guest

    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/
     
    Ari Heino, May 19, 2009
    #5
  6. On Tue, 19 May 2009 15:05:58 -0700 (PDT), Helpful person
    <> wrote:

    >On May 19, 4:14 pm, Gus Richter <> wrote:
    >> Helpful person wrote:
    >> > On May 19, 3:41 pm, Helpful person <> 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.
     
    Raymond Schmit, May 19, 2009
    #6
  7. Helpful person

    dorayme Guest

    In article <guv3v2$r69$-september.org>,
    Gus Richter <> wrote:

    > Helpful person wrote:
    > > On May 19, 3:41 pm, Helpful person <> 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
     
    dorayme, May 19, 2009
    #7
  8. Helpful person

    Gus Richter Guest

    dorayme wrote:
    > In article <guv3v2$r69$-september.org>,
    > Gus Richter <> wrote:
    >
    >> Helpful person wrote:
    >>> On May 19, 3:41 pm, Helpful person <> 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
     
    Gus Richter, May 20, 2009
    #8
  9. Helpful person

    Gus Richter Guest

    Helpful person wrote:
    > On May 19, 4:14 pm, Gus Richter <> wrote:
    >> Helpful person wrote:
    >>> On May 19, 3:41 pm, Helpful person <> 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
     
    Gus Richter, May 20, 2009
    #9
  10. On May 19, 6:05 pm, Helpful person <> wrote:
    > On May 19, 4:14 pm, Gus Richter <> wrote:
    >
    >
    >
    >
    >
    > > Helpful person wrote:
    > > > On May 19, 3:41 pm, Helpful person <> 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.
     
    Helpful person, May 20, 2009
    #10
  11. Helpful person 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?


    No.


    --
    Take care,

    Jonathan
    -------------------
    LITTLE WORKS STUDIO
    http://www.LittleWorksStudio.com
     
    Jonathan N. Little, May 20, 2009
    #11
  12. Helpful person

    dorayme Guest

    In article <guvf24$s50$-september.org>,
    Gus Richter <> wrote:

    > 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.
    >


    Unless I (a leading martian photographer) wanted to do some sort of HTML
    art - photography peculiar to the webpage - I prepare photos to the size
    I want beforehand. At least in respect to aspect ratio. How one works on
    an individual photograph beforehand is a different matter and a big one
    too.

    There is the *natural aspect* that is preserved no matter how you crop a
    pic. Cropping a pic that is 16" x 20" to 10" x 10" (to show just the
    head of someone, say) does not change the "natural aspect" of the
    details. In other words, there is no distortion. And this natural aspect
    is constant under projection, the variable being only distance from neg
    to paper or in the case of a webpage, the size of the browser window
    (the width/height ratio of the file image being able to be preserved in
    some if not all browsers).

    Photographers very rarely change the natural aspect of their pictures.
    Now and then I have corrected some converging lines by angling the paper
    or the lens but this is rare.


    > > 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?


    No, that particular bike, a Triumph Trophy, was stolen on a trip to
    Melbourne. When a partner and I came back to it in a street one evening,
    all that was there was a broken link from the chain! The scene of a
    bloke and his wife with helmets in hand (we still had the helmets)
    hitching back to Sydney must have looked a bit peculiar to others. I
    know I felt silly and furious at the same time.

    --
    dorayme
     
    dorayme, May 20, 2009
    #12
  13. Helpful person

    Gus Richter Guest

    dorayme wrote:
    > In article <guvf24$s50$-september.org>,
    > Gus Richter <> wrote:
    >
    > Photographers very rarely change the natural aspect of their pictures.
    > Now and then I have corrected some converging lines by angling the paper
    > or the lens but this is rare.


    I was thinking along the lines of using a "fisheye lens" for the effect.

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

    >
    > No, that particular bike, a Triumph Trophy, was stolen on a trip ....


    Sounds like you had more than one. Takes me back to my younger days. I
    had only one for a few years, a BSA 650cc Golden Flash. Friends rode BSA
    Rocket, Triumphs, Nortons. Some of my wilder years.

    --
    Gus
     
    Gus Richter, May 20, 2009
    #13
    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. Dan
    Replies:
    8
    Views:
    8,266
  2. UJ
    Replies:
    2
    Views:
    7,525
    John Timney \(ASP.NET MVP\)
    Jun 27, 2005
  3. J.O. Aho
    Replies:
    8
    Views:
    1,881
    Neredbojias
    Jan 13, 2007
  4. Jason Cavett

    Preferred Size, Minimum Size, Size

    Jason Cavett, May 23, 2008, in forum: Java
    Replies:
    5
    Views:
    12,587
    Michael Jung
    May 25, 2008
  5. Mark
    Replies:
    6
    Views:
    233
Loading...

Share This Page