2019独角兽企业重金招聘Python工程师标准>>>
jquery的resize()方法使用
<html>
<head>
<script type="text/javascript" src="/jquery/jquery.js"></script>
<script type="text/javascript" src="jquery-1.3.2.min.js"></script>
<script type="text/javascript">
var i = 0;
$(document).ready(function(){
$(window).resize(function() {
i++;
var Width = document.documentElement.clientWidth;
var Height = document.documentElement.clientHeight;
alert(i);
});
});
</script>
</head>
</html>
测试地址:
http://www.w3school.com.cn/tiy/t.asp?f=jquery_event_resize