Home >Web Front-end >JS Tutorial >js method to shrink and center the window after clicking a link_javascript skills
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
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.