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

WBOY
Release: 2016-05-16 16:05:45
Original
1120 people have browsed it

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>
Copy after login

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

source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template