ASU Web Community

Links: Maximizing the new window

Tuesday, December 4th, 2007 - 3:05 pm
  • mkrapp
  • mkrapp's picture

I have a page with a link. The link opens a new window via a target= param. I want the new browser window to be miximized, and have all the attributes of the current window (example: same toolbars, resizable-ness, etc). Anyone know the best way to do this? Javascript allows me to create the new window, but how do I get it to maximize?

Wednesday, December 5th, 2007 - 9:24 am
  • bbailey1
  • bbailey1's picture

for example:

<script>
var newwindow;
function poptastic(url) {
newwindow = window.open(url,'name','height='+window.screen.height+',width='+window.screen.width+',scrollbars=yes');
if(window.focus) {newwindow.focus()}
}
</script>

<a href="javascript:poptastic('yourpage.php');">Need help?</a>

 

With 2 monitors, this works fine in Firefox, however Internet Explorer will choose the size of the primary monitor. 

Friday, December 7th, 2007 - 11:25 pm
  • mkrapp
  • mkrapp's picture

Thanks Bill!