BootWiki教程网
源代码:
点击运行
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>BootWiki 教程网</title> <script src="//cdn.staticfile.net/jquery/1.4.2/jquery.min.js"></script> <script> $(document).ready(function(){ $("button").click(function(){ $("#span1").text($(window).height()); $("#span2").text($(document).height()); }); }); </script> </head> <body> <p>这个窗口的高度 <span id="span1">未知</span> px。</p> <p>这个文档的高度 <span id="span2">未知</span> px。</p> <button>返回窗口和文档元素的高度</button> </body> </html>
运行结果