116、窗口的缩小居中

116、窗口的缩小居中

脚本说明:

把如下代码加入<head>区域中

<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>

 

<a href="#" onclick="this_win(50,50)">点这里看看</a>

 

Write a comment

Comments: 0