This article mainly introduces how to narrow down and center the window after clicking a link in js. The example analyzes the javascript operation window skills and has some reference value, for more information about how to narrow down and center the window after clicking the link in js, see the example in this article. Share it with you for your reference. The specific analysis is as follows:
This is a simple JS special effect. it has never been seen before. when you click a text link on the page, the page window is reduced and displayed in the center, then display the link content in the center window. I hope these webpage effects will be useful in the future.
The code is as follows:
Center the window
Center-down window display
|
JS effect display |
SCRIPT
Function this_win (w, h ){
Var ww = window. screen. width * w/100;
Var hh = window. screen. height * h/100;
Window. resizeTo (ww, hh );
Window. moveTo (Math. ceil (window. screen. width-ww)/2), Math. ceil (window. screen. height-hh)/2 ));
}
SCRIPT
Click here, Baidu
|
I hope this article will help you design javascript programs.