Tuesday, August 30, 2011

How to open new window (popup) and center on screen

Here is a JavaScript function that open a new window and put in on the center of screen

<script type="text/javascript">

function poponload() {

var left = (screen.width / 2) - (990 / 2);

var top = (screen.height / 2) - (560 / 2);

testwindow = window.open('MyTestPopUp.aspx', 'PopUp', 'location=1,status=1,scrollbars=1,resizable=0,width=990, height=560, top='+top+', left='+left);

       

}

</script>

No comments:

Post a Comment

If you’re using Visual Studio to build your .NET MAUI app on a Mac, locating the IPA (iOS App Package) file can be a bit tricky

  If you’re using   Visual Studio   to build your   .NET MAUI   app on a   Mac , locating the   IPA (iOS App Package)   file can be a bit tr...