<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd "> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <title>Insert title here</title> <script src="http://code.jquery.com/jquery-latest.js "></script> <script language="javascript"> $(document).ready(function(){ $(window).resize(function() { $('#log').append('<div>Handler for .resize() called. Window widthis ' + $(window).width() + '</div>'); }); }); </script> </head> <body> <div id="log">请缩小或放大窗口。</div> </body> </html>
Jquery中的resize方法
最新推荐文章于 2025-07-26 10:34:35 发布
本文介绍了一个简单的示例,展示了如何使用jQuery来检测浏览器窗口的大小变化,并在窗口尺寸改变时更新页面上的元素。通过这个例子,读者可以了解jQuery的基础用法以及如何在实际项目中应用这些技术。
1711

被折叠的 条评论
为什么被折叠?



