jq 监听调整浏览器窗口的大小

<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

猜你喜欢

转载自www.cnblogs.com/zc290987034/p/9149814.html
jq
今日推荐