Link to home
Start Free TrialLog in
Avatar of John Account
John Account

asked on

Open PopUp Window Maximized

Hello Experts. I have thumbnails on a web page that, when clicked, opens a popup window displaying a jpg. I want the popup browser to open maximized, since all the images are different sizes. I'm using the code below, but it's not working. Please advise. Many kind thanks in advance!

<SCRIPT LANGUAGE="JavaScript">
function winPopUp(URL) {
day = new Date();
id = day.getTime();
eval("page" + id + " = window.open(URL, '" + id + "', 'addressbar=0,toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=1,screenX=0,screenY=0,top=0,left=0,maximize=1');");
}
</script>

<a href="javascript:winPopUp('images/photo1.jpg')">Link</a>
Avatar of mrwad99
mrwad99
Flag of United Kingdom of Great Britain and Northern Ireland image

This is a simple example I found that I use,it uses the availWidth and availHeight

w=800
h=600
if (window.screen) {
w = window.screen.availWidth;
h = window.screen.availHeight;
}
window.open('myPage.html','newwindow','width='+w+',height='+h+',top=0,left=0');

HTH
ASKER CERTIFIED SOLUTION
Avatar of GwynforWeb
GwynforWeb
Flag of Canada image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of John Account
John Account

ASKER

Thank you, GwynforWeb. Perfect!