[Last Call] Learn how to a build a cloud-first strategyRegister Now

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

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>
0
John Account
Asked:
John Account
1 Solution
 
mrwad99Commented:
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
0
 
GwynforWebCommented:
<script LANGUAGE="JavaScript">function winPopUp(URL) {
 day = new Date();
 id = day.getTime();
 str='addressbar=0,toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=1,screenX=0,screenY=0,top=0,left=0,maximize=1,'
 str=str+'height='+screen.height+', width='+screen.width
 eval('page' + id+'=window.open(URL, id,str )')
}
</script>
<a href="javascript:winPopUp('http://www.experts-exchange.com/images/indexLogoPerson_07.gif')">
0
 
John AccountAuthor Commented:
Thank you, GwynforWeb. Perfect!
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

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