Solved

child window size control for resolution

Posted on 2004-09-20
3
142 Views
Last Modified: 2011-10-03
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
Comment
Question by:fhtong
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 13

Expert Comment

by:cLFlaVA
ID: 12102975

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

Author Comment

by:fhtong
ID: 12108289
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
 
LVL 5

Accepted Solution

by:
apparition earned 500 total points
ID: 12111569
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

Featured Post

Instantly Create Instructional Tutorials

Contextual Guidance at the moment of need helps your employees adopt to new software or processes instantly. Boost knowledge retention and employee engagement step-by-step with one easy solution.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Article by: DanRollins
This article describes a JavaScript program that creates a maze made of hexagonal cells.  In Part 2 (http://www.experts-exchange.com/Programming/Languages/Scripting/JavaScript/A_7850-Hex-Maze-Part-2.html), we'll extend the program by adding a depth-…
This article discusses the difference between strict equality operator and equality operator in JavaScript. The Need: Because JavaScript performs an implicit type conversion when performing comparisons, we have to take this into account when wri…
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

717 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question