案例:jquery案例     状态:可编辑再运行    进入竖版
 运行结果 
x
 
1
<!DOCTYPE html>
2
<html>
3
<head>
4
<script src="/js/jquery-1.11.1.min.js"></script>
5
<script>
6
$(document).ready(function(){
7
  $("button").click(function(){
8
    var txt="";
9
    txt+="Document width/height: " + $(document).width();
10
    txt+="x" + $(document).height() + "\n";
11
    txt+="Window width/height: " + $(window).width();
12
    txt+="x" + $(window).height();
13
    alert(txt);
14
  });
15
});
16
</script>
17
</head>
18
<body>
19
20
<button>显示文档和窗口的尺寸</button>
21
22
</body>
23
</html>
24