js获得分辨率

来源:互联网 发布:淘宝付款怎么用支付宝 编辑:程序博客网 时间:2024/04/30 09:30

这里我用这个我以前做的一个打开一个新的页面的代码来做例 子:

function init(){
         var tt =  window.open('faces/default.jsp','_blank','top=0,left=0,status=no,menubar=no,scrollbars=no,resizable=yes,width='+ screen.width+',height='+screen.height);
         if(tt != null){
              window.opener = null;
              window.close();
         }
}

width='+ screen.width+',height='+screen.height);
这2句话就是获得现在本机的分辨率

原创粉丝点击