Home >Web Front-end >JS Tutorial >js method to shrink and center the window after clicking a link_javascript skills

js method to shrink and center the window after clicking a link_javascript skills

WBOY
WBOYOriginal
2016-05-16 16:11:421419browse

The example in this article describes how to use js to shrink and center the window after clicking a link. Share it with everyone for your reference. The specific analysis is as follows:

This is a simple JS effect that I have never seen before. When you click on the specified text link on the page, the page window shrinks and is displayed in the center, and then the link content is displayed in the centered window. I hope these web pages Special effects can come in handy later

Copy code The code is as follows:

Reducing and centering the window






Shrink and center the window









JS effect display


<SCRIPT><br> function this_win(w,h){<br> var ww=window.screen.width*w/100;<br> var hh=window.screen.height*h/100;<br> window.resizeTo(ww,hh);<br> window.moveTo(Math.ceil((window.screen.width-ww)/2),Math.ceil((window.screen.height-hh)/2));<br> }<br> </SCRIPT>
Click here to search on Baidu


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