I'm looking for the solution on how to make my popup window depend on a screen resolution. I'm using javascript, since this is a requirement.
My pop up window opens when the following function is called:
function openContent("mypage.htm);
I was trying to figure it out and have the following:
function openContent(url) {
var width = 900;
var height = 900;
var left = screen.width/4;
var top = 0;
var win;
alert("Screen Height: " + screen.height);
alert("Screen Width: " + screen.width);
if (screen.width < 900) {
width = screen.width - 100;
left = screen.width - width ;
}
if (screen.height <= 900) {
height = screen.height - 70;
width = width - 100;
}
win = window.open(url, 'content', "toolbar=no, titlebar=no, status=no, scrollbars=yes, resizable=no, top=" + top + ", left=" + left + ", width=" + width + ", height=" + height + "\"");
win.focus();
}
I have two desktops at my work place. When trying with different resolution, this page sometimes is split between 2 desktops.
Also, some part of a window is hidden when its height is greater than screen's height. I'm also thinking about laptop users. Will they be able to see the whole page as well
What is a good solution to that?
Thank you