0

I need to maximize my popup window on load tried below code but doesn't work, I am using IE11 browser.

<script>
window.moveTo(0, 0);
  window.resizeTo(screen.width, screen.height);
</script>
madhu
  • 244
  • 5
  • 13

3 Answers3

1

This is working for me and should work for you please try :

<!DOCTYPE html>
<html>
<body>

<p>Open a new window</p>

<button onclick="openWin()">Create window</button>

<script>
var myWindow;

function openWin() {
    var x = screen.width;
    var y = screen.height;

    myWindow = window.open("https://stackoverflow.com/", "mywindow", "width="+x+",height="+y+",fullscreen=yes");
    myWindow.moveTo(0, 0);

}

</script>

</body>
</html>
RVCoder
  • 522
  • 4
  • 14
1
<script
src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js"></script>
<script>
function maximize() {
  //Your logic here
}
$(document).ready(function(){
  maximize();
});
</script>

This is for firing the method on load of the document and for the logic implementation part, I suggest you read this: https://stackoverflow.com/a/7525760/6644368

Yash
  • 11,486
  • 4
  • 19
  • 35
0

I use this demo below code


myWindow=window.open('','','width=100%,height=100%');
myWindow.document.write("This is 'myWindow'");
myWindow.moveTo(0,0);
myWindow.resizeTo(screen.width, screen.height);