菜单切换
FACESOHO知行者
心灵
记录
远方
赞赏工具
源代码:
点击运行
保存
<!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <script src="https://cdn.staticfile.org/jquery/1.10.2/jquery.min.js"> </script> <script> $(document).ready(function(){ $("button").click(function(){ var txt=""; txt+="文档 width/height: " + $(document).width(); txt+="x" + $(document).height() + "\n"; txt+="窗口 width/height: " + $(window).width(); txt+="x" + $(window).height(); alert(txt); }); }); </script> </head> <body> <button>显示文档和窗口的尺寸</button> </body> </html>
运行结果