Solution 1 :

Just get the reference of the created window and adjust it height and width properties.

function myFunction() {
    const win = window.open(
        "https://www.w3schools.com",
        "_blank",
        "toolbar=yes,scrollbars=yes,resizable=yes,top=500,left=500,width=400,height=400"
    );

    win.height = 600;
    win.width = 800;
}

Problem :

I try to rezise windows browser with JS or Angular after opened, but i can find that looking for

step one

We have this function

function myFunction() {
  window.open(
        "https://www.w3schools.com",
        "_blank",
        "toolbar=yes,scrollbars=yes,resizable=yes,top=500,left=500,width=400,height=400"
    );
}

step 2

when the window is open and the page is loaded I need that window resize to
width=800, height=600 with javascript or Angular, please no JQuery.

And I cant find some function that make do that.

Greatings | Thanks

EDIT and add details

Note: the window that open/contain window.open function, cant be modificated and doesn’t have reference like @Ashish Ranjan sais with win.width = 800;

so, this cant be solution:

function myFunction() {
    const win = window.open(
        "https://www.w3schools.com",
        "_blank",
        "toolbar=yes,scrollbars=yes,resizable=yes,top=500,left=500,width=400,height=400"
    );

    win.height = 600;
    win.width = 800;
}

Comments

Comment posted by RobG

Reā€“sizing a window is often really annoying, especially given the very large screens some users use. Please consider usability very carefully before doing this.

By

Leave a Reply

Your email address will not be published. Required fields are marked *