<html>
<head>
<script type="text/javascript" src="http://www.w3school.com.cn/jquery/jquery.js"></script>
<script type="text/javascript">
x=0;
$(document).ready(function(){
$(window).resize(function() {
$("span").text(x+=1);
});
});
</script>
</head>
<body>
<p>窗口大小被调整过 <span>0</span> 次。</p>
<p>请试着重新调整浏览器窗口的大小。</p>
</body>
</html>
演练网址:http://www.w3school.com.cn/jquery/event_resize.asp
原文地址:https://www.cnblogs.com/zc290987034/p/9149814.html
时间: 2024-11-09 00:52:26