fmpq.com
源代码:
点击运行
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>Fmpq教程(fmpq.com)</title> <script src="https://apps.bdimg.com/libs/jquery/2.1.4/jquery.min.js"> </script> <script> $(document).ready(function(){ $("button").click(function(){ $("#span1").text($(window).width()); $("#span2").text($(document).width()); }); }); </script> </head> <body> <p>窗口宽度是 <span id="span1">未知</span> px.</p> <p>该文档的宽度是 <span id="span2">未知</span> px.</p> <button>返回窗口和文档元素的宽度</button> </body> </html>
运行结果