Home >Web Front-end >JS Tutorial >How to dynamically modify the size of pop-up windows in JavaScript_javascript skills

How to dynamically modify the size of pop-up windows in JavaScript_javascript skills

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOriginal
2016-05-16 16:05:451167browse

The example in this article describes the method of dynamically modifying the pop-up window size using JavaScript. Share it with everyone for your reference. The details are as follows:

The following JS code demonstrates how to pop up a new window through window.open and then dynamically modify the window size

<!DOCTYPE html>
<html>
<head>
<script>
var w;
function openwindow()
{
w=window.open('','', 'width=100,height=100');
w.focus();
}
function myFunction()
{
w.resizeTo(500,500);
w.focus();
}
</script>
</head>
<body>
<button onclick="openwindow()">Create window</button>
<button onclick="myFunction()">Resize window</button>
</body>
</html>

I hope this article will be helpful to everyone’s JavaScript programming design.

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn