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> x=0; $(document).ready(function(){ $(window).resize(function(){ $("span").text(x+=1); }); $("button").click(function(){ $(window).resize(); }); }); </script> </head> <body> <p>窗口重置了 <span>0</span> 次大小。</p> <button>触发窗口的 resize 事件</button> </body> </html>
运行结果