Web Analytics Made Easy -
StatCounter setting main window's resizability.. - CodingForum

Announcement

Collapse
No announcement yet.

setting main window's resizability..

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • setting main window's resizability..

    ok, I know i can use window.open() to open a window from my main page, and there i can declair if the window is resizable or not. This is not what i am trying to do..... for all of you who may be thinking that.

    I am trying to set the width and height of my main window, and once set keep the user from resizing it. (not a child window/pop-up) but the parent window.

    I have never tried doing this before, and cant actually say i have ever seen someone do it, so i'm not sure if it can be done.


    thanx in advance for any help.
    I make no attempt at pretending like I'm a professional. I offer help with what knowledge I do have.

  • #2
    Your visitors set their main window size and decide whether you can resize popup windows. They have the final say on window sizes since it is their browser. You can try to set popup window sizes which will work if your visitors allow it but you can't change the size of their main window. The browser owner always has the final say on everything except the actual content of your web page.
    Stephen
    Learn Modern JavaScript - http://javascriptexample.net/
    Helping others to solve their computer problem at http://www.felgall.com/

    Don't forget to start your JavaScript code with "use strict"; which makes it easier to find errors in your code.

    Comment


    • #3
      Why would you want to do this? Let me guess you can't get your site to look the same at all resolutions?
      ||||If you are getting paid to do a job, don't ask for help on it!||||

      Comment


      • #4
        to answer your question...

        I am actually making a small HTA program.

        because it is a .hta file, when it opens all you see is the window frame and the window title bar with the minimize, resize, and close buttons.

        I put in my own " File Edit View " bar which blends into the window frame as if it were part of the window. then I put an iframe below it that is 500x600. the total content of the iframe only needs that 500x600.
        I set the window's width and height as soon as it loads so that the iframe blends perfectly into the window's frame. basically making the i frame look like the normal frame of a normal window. the window will not need to be resized or scrolled whatsoever. so me being the ocd kind of person i am was thinking that some people would try to resize it anyway( i dont know why but some people are like that). so, i want to keep them from resizing it.

        initially i set the windows width and height first thing off and in the <body> tag i used the onresize handler to basically resize the window to 500x600. problem there though......using the onresize handler to resize the window just causes problems, lol. so i thought of trying to just set the window's resizeable propert to no after resizing it the very first time.
        I make no attempt at pretending like I'm a professional. I offer help with what knowledge I do have.

        Comment


        • #5
          I think i found a possible work around. i can have one .hta file open my .hta file using window.open(), in which case i can set if the window is resizeable.
          I make no attempt at pretending like I'm a professional. I offer help with what knowledge I do have.

          Comment


          • #6
            Hmm have you tried window.open yet? I got no such interface supported as a js error. Best you can probably do is
            Code:
            <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
            <html xmlns="http://www.w3.org/1999/xhtml">
            <head>
            <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
            <title>Untitled Document</title>
            <script type="text/javascript">
            function sizeIt()
            {
            	window.resizeTo(800,600);
            }
            window.onload = sizeIt;
            window.onresize = sizeIt;
            </script>
            </head>
            
            <body>
            </body>
            </html>
            or make the iframe width and height variable meaning use percentages.
            ||||If you are getting paid to do a job, don't ask for help on it!||||

            Comment


            • #7
              yeah, i thought of using the window.onresize the resize the window, but same problem, using the onresize handler/event to resize....... see the delima.
              hang on, im gunna check this out, gunna throw an alert in there and see if it gives me infinite alerts or not. ok, i can use that it only gave me 2 alerts, instead of infinite alerts (which is what i was afraid of, an infinite loop.).
              I make no attempt at pretending like I'm a professional. I offer help with what knowledge I do have.

              Comment

              Working...
              X