PDA

View Full Version : open a new maximized from a pop up menu



auro2u
02-27-2006, 06:17 AM
Sir,

How do i open a maximized window from a pop up menu , where the pop up menu is not allowed to resize and has a function for fixed width and height.

Regards.

Auro.

jscheuer1
02-27-2006, 07:23 AM
Well, it really doesn't matter where you are opening from. To open a maximized window, involves two basic steps, to handle things in the two styles of browser that may be used to view your page. For most browsers, that can calculate the width and height of the new window's chrome as well as its specified dimensions and location "on the fly" but that may not allow you to resize an existing window, launch your new window like so:


<a href="whatever.htm" target="_blank" onclick="window.open(this.href, '', 'location, toolbar, top=0, left=0, width='+screen.availWidth+', height='+screen.availHeight);return false;">Open Big Window</a>

On the page that opens in this window, you need a script in the head to take care of details that some browsers cannot calculate on the fly. Fortunately, all such browsers that I know of will allow resizing and repositioning of open windows:


<script type="text/javascript">
onload=function(){
window.moveTo(0, 0);
window.resizeTo(screen.availWidth, screen.availHeight);
}
</script>