resize browser window on load

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • chris

    resize browser window on load

    how would i resize a browser window to a specific size as the page loads,
    using html or javascript



  • Andrew Thompson

    #2
    Re: resize browser window on load

    On Mon, 6 Sep 2004 17:35:17 +0800, chris wrote:
    [color=blue]
    > how would i resize a browser window to a specific size as the page loads,
    > using html or javascript[/color]

    Why? What is in the pages?

    Most of the time it is better to design a
    page that fits any screen and let the user
    retain control of the size themselves.

    Please note that cross-posting to three groups
    is generally frowned upon, though I note that
    you were unsure which group was best and
    did not commit the 'sin' of multi-posting..

    I will set the Follow-Ups to the best group,
    should you decide to do such a thing,
    comp.lang.javas cript.

    (While the HTML folks might be more aware of
    how to make a page 'squeezy', the JS guru's
    are certainly familiar with it.)

    --
    Andrew Thompson
    http://www.PhySci.org/ Open-source software suite
    http://www.PhySci.org/codes/ Web & IT Help
    http://www.1point1C.org/ Science & Technology

    Comment

    • Karl Groves

      #3
      Re: resize browser window on load


      "chris" <someone@here.c om> wrote in message
      news:413c2f55$1 @funnel.arach.n et.au...[color=blue]
      > how would i resize a browser window to a specific size as the page loads,
      > using html or javascript[/color]

      Leave the user's window alone.
      It might be your website, but it is their computer.

      -Karl


      Comment

      • McKirahan

        #4
        Re: resize browser window on load

        "chris" <someone@here.c om> wrote in message
        news:413c2f55$1 @funnel.arach.n et.au...[color=blue]
        > how would i resize a browser window to a specific size as the page loads,
        > using html or javascript[/color]

        <html>
        <head>
        <title>resizeto .htm</title>
        </head>
        <body onload="moveTo( 0,0); resizeTo(400,30 0);">
        </body>
        </html>


        Comment

        • Karl Groves

          #5
          Re: resize browser window on load


          "McKirahan" <News@McKirahan .com> wrote in message
          news:nK%_c.2530 41$8_6.236481@a ttbi_s04...[color=blue]
          > "chris" <someone@here.c om> wrote in message
          > news:413c2f55$1 @funnel.arach.n et.au...[color=green]
          > > how would i resize a browser window to a specific size as the page[/color][/color]
          loads,[color=blue][color=green]
          > > using html or javascript[/color]
          >
          > <html>
          > <head>
          > <title>resizeto .htm</title>
          > </head>
          > <body onload="moveTo( 0,0); resizeTo(400,30 0);">
          > </body>
          > </html>[/color]


          Congratulations . You've shown the OP a great way to confuse and annoy
          visitors.

          -Karl


          Comment

          • Randy Webb

            #6
            Re: resize browser window on load

            Karl Groves wrote:
            [color=blue]
            > "McKirahan" <News@McKirahan .com> wrote in message
            > news:nK%_c.2530 41$8_6.236481@a ttbi_s04...
            >[color=green]
            >>"chris" <someone@here.c om> wrote in message
            >>news:413c2f55 $1@funnel.arach .net.au...
            >>[color=darkred]
            >>>how would i resize a browser window to a specific size as the page[/color][/color]
            >
            > loads,
            >[color=green][color=darkred]
            >>>using html or javascript[/color]
            >>
            >><html>
            >><head>
            >><title>resize to.htm</title>
            >></head>
            >><body onload="moveTo( 0,0); resizeTo(400,30 0);">
            >></body>
            >></html>[/color]
            >
            >
            >
            > Congratulations . You've shown the OP a great way to confuse and annoy
            > visitors.[/color]

            Not only that, but a method that fails in some scenarios.



            --
            Randy
            comp.lang.javas cript FAQ - http://jibbering.com/faq

            Comment

            • Sam Hughes

              #7
              Re: resize browser window on load

              "Karl Groves" <karl@NOSPAMkar lcore.com> wrote in news:chi1uq$sru $1@ngspool-
              d02.news.aol.co m:
              [color=blue]
              >
              > "McKirahan" <News@McKirahan .com> wrote in message
              > news:nK%_c.2530 41$8_6.236481@a ttbi_s04...[color=green]
              >> "chris" <someone@here.c om> wrote in message
              >> news:413c2f55$1 @funnel.arach.n et.au...[color=darkred]
              >> > how would i resize a browser window to a specific size as the page[/color][/color]
              > loads,[color=green][color=darkred]
              >> > using html or javascript[/color]
              >>
              >> <html>
              >> <head>
              >> <title>resizeto .htm</title>
              >> </head>
              >> <body onload="moveTo( 0,0); resizeTo(400,30 0);">
              >> </body>
              >> </html>[/color]
              >
              >
              > Congratulations . You've shown the OP a great way to confuse and annoy
              > visitors.[/color]

              So you think we should hide information from them?

              The next thing you know, we'll stop teaching chemistry in high school, lest
              anybody figure out how to make a bomb.

              Comment

              • Sam Hughes

                #8
                Re: resize browser window on load

                "chris" <someone@here.c om> wrote in news:413c2f55$1 @funnel.arach.n et.au:
                [color=blue]
                > how would i resize a browser window to a specific size as the page
                > loads, using html or javascript[/color]

                The real question is, how could you design your page better so it doesn't
                need this behavior. After all, you can't do what you want on many
                browsers, including ones with javascript selectively turned on.

                Comment

                • Neal

                  #9
                  Re: resize browser window on load

                  On 6 Sep 2004 17:13:40 GMT, Sam Hughes <hughes@rpi.edu > wrote:
                  [color=blue]
                  > "Karl Groves" <karl@NOSPAMkar lcore.com> wrote in
                  > news:chi1uq$sru $1@ngspool-
                  > d02.news.aol.co m:[color=green]
                  >> Congratulations . You've shown the OP a great way to confuse and annoy
                  >> visitors.[/color]
                  >
                  > So you think we should hide information from them?
                  >
                  > The next thing you know, we'll stop teaching chemistry in high school,
                  > lest
                  > anybody figure out how to make a bomb.[/color]

                  There's a difference, in my opinion.

                  First, if we teach the chemical method of producing a huge explosion, we
                  also must responsibly mention that it's probably not a good idea to do
                  this in your basement or classroom.

                  Second, and I've used this analogy before, if someone wrote to you asking
                  what the best methods of suicide were, and it was clear from their message
                  that the question was not merely academic, I'm sure you'd be reluctant to
                  entertain the idea of suicide with this person. Rather, I'd hope you'd
                  attempt to help them out of their current situation toward a more healthy
                  one.

                  When people ask questions which are not answerable directly without ending
                  up as suporting poor practice, and we do so anyway, we're advising someone
                  to do something which is bad for the web.

                  This is why so many questions here are answered with "Why do you want to
                  do this? It's going to lead to no good." Because it's the only responsible
                  answer.

                  Comment

                  • Sam Hughes

                    #10
                    Re: resize browser window on load

                    Neal <neal413@yahoo. com> wrote in
                    news:opsdw050n6 6v6656@news.ind ividual.net:
                    [color=blue]
                    > When people ask questions which are not answerable directly without
                    > ending up as suporting poor practice, and we do so anyway, we're
                    > advising someone to do something which is bad for the web.
                    >
                    > This is why so many questions here are answered with "Why do you want
                    > to do this? It's going to lead to no good." Because it's the only
                    > responsible answer.[/color]

                    But alas, in this case, other people have already given that aspect of the
                    answer.

                    Comment

                    • Andrew Thompson

                      #11
                      Re: resize browser window on load

                      On 6 Sep 2004 17:13:40 GMT, Sam Hughes wrote:
                      [color=blue][color=green]
                      >> Congratulations . You've shown the OP a great way to confuse and annoy
                      >> visitors.[/color]
                      >
                      > So you think we should hide information from them?[/color]

                      What, the visitors? No, of course not.
                      Ohh.. if you mean the naiive web-authors? Probably.
                      [color=blue]
                      > The next thing you know, we'll stop teaching chemistry in high school,[/color]

                      Nobody ever needed Javascript to make
                      bread rise, or perform an alkilinity
                      or soil or water test...
                      [color=blue]
                      >..lest anybody figure out how to make a bomb.[/color]

                      I do not think there is any case to compare the two.

                      [ F'Ups set to c.l.js ]

                      --
                      Andrew Thompson
                      http://www.PhySci.org/ Open-source software suite
                      http://www.PhySci.org/codes/ Web & IT Help
                      http://www.1point1C.org/ Science & Technology

                      Comment

                      • Karl Groves

                        #12
                        Re: resize browser window on load


                        "Sam Hughes" <hughes@rpi.edu > wrote in message
                        news:Xns955C868 F1E97Chughesrpi edu@130.133.1.4 ...[color=blue]
                        > "Karl Groves" <karl@NOSPAMkar lcore.com> wrote in[/color]
                        news:chi1uq$sru $1@ngspool-[color=blue]
                        > d02.news.aol.co m:[color=green]
                        > > Congratulations . You've shown the OP a great way to confuse and annoy
                        > > visitors.[/color]
                        >
                        > So you think we should hide information from them?
                        >
                        > The next thing you know, we'll stop teaching chemistry in high school,[/color]
                        lest[color=blue]
                        > anybody figure out how to make a bomb.[/color]

                        A plethora of lessons learned today on alt.html.
                        Ladies and Gentlemen, Mr. Hughes has just demonstrated the "slippery slope".

                        -Karl


                        Comment

                        • Lee

                          #13
                          Re: resize browser window on load

                          Sam Hughes said:[color=blue]
                          >
                          >"Karl Groves" <karl@NOSPAMkar lcore.com> wrote in news:chi1uq$sru $1@ngspool-[/color]
                          [color=blue][color=green]
                          >> Congratulations . You've shown the OP a great way to confuse and annoy
                          >> visitors.[/color]
                          >
                          >So you think we should hide information from them?
                          >
                          >The next thing you know, we'll stop teaching chemistry in high school, lest
                          >anybody figure out how to make a bomb.[/color]

                          Your analogy is wrong.
                          If a high school student asks what he could mix together to get
                          an explosion, it would be irresponsible to give him an easy to
                          follow recipe. Particularly if you don't at least mention that
                          it would be a really bad idea to do it.

                          Comment

                          • Toby Inkster

                            #14
                            Re: resize browser window on load

                            Sam Hughes wrote:
                            [color=blue]
                            > The next thing you know, we'll stop teaching chemistry in high school, lest
                            > anybody figure out how to make a bomb.[/color]

                            Teach Chemistry by all means, but if a student comes up to you and asks
                            for a recipe for Semtex, be suspicious.

                            --
                            Toby A Inkster BSc (Hons) ARCS
                            Contact Me ~ http://tobyinkster.co.uk/contact
                            Now Playing ~ ./ed_harcourt/from_every_sphe re/09_watching_the _sun_come_up.og g

                            Comment

                            • Dr John Stockton

                              #15
                              Re: resize browser window on load

                              JRS: In article <chhojk$n5n$1@n gspool-d02.news.aol.co m>, dated Mon, 6
                              Sep 2004 09:27:13, seen in news:comp.lang. javascript, Karl Groves
                              <karl@NOSPAMkar lcore.com> posted :[color=blue]
                              >
                              >"chris" <someone@here.c om> wrote in message
                              >news:413c2f55$ 1@funnel.arach. net.au...[color=green]
                              >> how would i resize a browser window to a specific size as the page loads,
                              >> using html or javascript[/color]
                              >
                              >Leave the user's window alone.
                              >It might be your website, but it is their computer.[/color]

                              Setting the window size is a perfectly reasonable thing to do, in some
                              circumstances.

                              Consider <URL:http://www.merlyn.demo n.co.uk/js-quick.htm>; it is
                              primarily for my benefit as a local page, but I publish it so that
                              others may make modify and use their own local copy. It presents some
                              controls in a form, and sizes itself to fit those controls in my
                              browser. IIRC, it also fits in MSIE 5.5 or 6; those with browsers in
                              which it does not fit can adjust the numbers.

                              Consider my private local home page; it has
                              <BODY onLoad="window. resizeTo(640, 960)">
                              because that suits my way of working (/inter alia/, I can normalise the
                              size of a displayed page by Home, Back).


                              Granted, resizing can be, and commonly is, misused; but there is no
                              reason to assert that the poster must want to misuse it. A conditional
                              warning is enough.


                              After resizing, one may wish to scroll to a particular location. There
                              are numerical scrolling commands; but it may be better to set focus to a
                              suitable element, so that the desired point is reached even if more text
                              is added above it.

                              --
                              © John Stockton, Surrey, UK. ?@merlyn.demon. co.uk Turnpike v4.00 IE 4 ©
                              <URL:http://www.jibbering.c om/faq/> JL/RC: FAQ of news:comp.lang. javascript
                              <URL:http://www.merlyn.demo n.co.uk/js-index.htm> jscr maths, dates, sources.
                              <URL:http://www.merlyn.demo n.co.uk/> TP/BP/Delphi/jscr/&c, FAQ items, links.

                              Comment

                              Working...