Improve company productivity with a Business Account.Sign Up

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 145
  • Last Modified:

child window size control for resolution

I have gone through the work for controlling the table size for various resolution with the help from experts. Now I meet another problem.
There are some child window to be displayed when readers click and the script is:

<script type="text/javascript">
<!--//hide
function SHOW_MEMO() {
window.open("memo.htm", "mypage", "height=600, width=700, top=0,left=0");
}
//-->
</script>
.
.
<a href="javascript:SHOW_LAYOUT()"onmouseover="window.status='click to see!'; return true" onMouseOut="window.status=' '; return true">MEMO</a>

How to set the percentage with this type of child window?
0
fhtong
Asked:
fhtong
1 Solution
 
cLFlaVACommented:

a) what do you mean by "set the percentage"
b) is "SHOW_LAYOUT()" above supposed to be "SHOW_MEMO()"?
0
 
fhtongAuthor Commented:
clFlaVA,

I mean that if the resolution is 800, then the child window will be height=600 width=700, if the resolution is 1024 or up, then then the child window will be height=768 width=900.

It would be better to use percentage so that other resolution can have the same displaying ratio.
0
 
apparitionCommented:
Try This,


<script type="text/javascript">
<!--//hide
function SHOW_LAYOUT() {
      if (navigator.appVersion.indexOf("4.") != -1 && 
                navigator.appName.indexOf("Explorer") != -1) {
           ScrnSize = screen.width + "x" + screen.height;
        }
      if (navigator.appVersion.indexOf("4.") != -1 && 
                navigator.appName.indexOf("Netscape") != -1) {
           ScrnSize = screen.width + "x" + (screen.height + 19); //Netscape sees 19 pixels less on Height
        }
      switch(ScrnSize) {
              case "640x480":   width=400;
             case "800x600":   width=600;
          case "1024x768":  width=800;
          case "1152x864":  width=1000;
            case "1280x1024": width=1100;
          case "1600x1200": width=1200;
            default:          height=400;
    }
      window.open("memo.htm", "mypage", "height=500, width=" + width + ", top=0,left=0");
}
//-->
</script>
.
.
<a href="javascript:SHOW_LAYOUT()"onmouseover="window.status='click to see!'; return true" onMouseOut="window.status=' '; return true">MEMO</a>
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now